From 9edc9248efc3da6aa11d31fe6917ff8edde95001 Mon Sep 17 00:00:00 2001 From: Ted Benson Date: Tue, 10 Oct 2023 13:59:03 -0400 Subject: [PATCH] newlines --- apps/workshop/app/api/steamship/chat/route.ts | 2 +- packages/client/package.json | 2 +- .../src/streaming/block-stream-to-streaming-block-stream.ts | 4 ++-- packages/client/src/streaming/steamship-stream.ts | 4 ++-- packages/client/tsup.config.ts | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/apps/workshop/app/api/steamship/chat/route.ts b/apps/workshop/app/api/steamship/chat/route.ts index d8d8617..5abb69f 100644 --- a/apps/workshop/app/api/steamship/chat/route.ts +++ b/apps/workshop/app/api/steamship/chat/route.ts @@ -41,7 +41,7 @@ export async function POST(req: Request) { const stream = await SteamshipStream(response, steamship, { streamTimeoutSeconds: 30, // Use: "markdown" | "json" - format: "json", + format: "markdown", }); // Respond with a stream of Markdown diff --git a/packages/client/package.json b/packages/client/package.json index d83720a..bc93f4b 100644 --- a/packages/client/package.json +++ b/packages/client/package.json @@ -1,6 +1,6 @@ { "name": "@steamship/client", - "version": "3.0.6", + "version": "3.0.8", "main": "./dist/index.js", "exports": { ".": "./dist/index.js" diff --git a/packages/client/src/streaming/block-stream-to-streaming-block-stream.ts b/packages/client/src/streaming/block-stream-to-streaming-block-stream.ts index 108cf6a..082d4b7 100644 --- a/packages/client/src/streaming/block-stream-to-streaming-block-stream.ts +++ b/packages/client/src/streaming/block-stream-to-streaming-block-stream.ts @@ -46,7 +46,7 @@ function BlockStreamToStreamingBlockStream( } // Upon a new block, we always pass it right on through. - controller.enqueue(JSON.stringify(block)); + controller.enqueue(JSON.stringify(block) + '\n'); // For blocks that are either TEXT or MARKDOWN and also streaming, we will additionally set up an update stream. const isStreaming = block.streamState == "started"; @@ -84,7 +84,7 @@ function BlockStreamToStreamingBlockStream( JSON.stringify({ id: blockId, text: streamingBlocks[blockId].text, - }) + }) + '\n' ); } diff --git a/packages/client/src/streaming/steamship-stream.ts b/packages/client/src/streaming/steamship-stream.ts index cfcfa08..c519f26 100644 --- a/packages/client/src/streaming/steamship-stream.ts +++ b/packages/client/src/streaming/steamship-stream.ts @@ -63,8 +63,8 @@ export async function SteamshipStream( timeoutSeconds: opts?.streamTimeoutSeconds || 60, }; if (requestId) { - filterDict["tagKindFilter"] = "request-id"; - filterDict["tagNameFilter"] = requestId; + // filterDict["tagKindFilter"] = "request-id"; + // filterDict["tagNameFilter"] = requestId; } if (opts?.minDatetime) { filterDict["minDatetime"] = opts?.minDatetime; diff --git a/packages/client/tsup.config.ts b/packages/client/tsup.config.ts index 28aac6f..c8845c7 100644 --- a/packages/client/tsup.config.ts +++ b/packages/client/tsup.config.ts @@ -8,7 +8,7 @@ const options: Options = { entry: { index: "index.ts", }, - minify: true, + minify: false, sourcemap: true, target: "es2020", };