The Open Standard for Generative UI
Bug Fix: Use EventType.value as event name for sse encoding (#99)
Rabi Shanker Guha7441f373d9dd
diff --git a/py/stream/pyproject.toml b/py/stream/pyproject.tomlindex 40af03d5c..361c15a42 100644--- a/py/stream/pyproject.toml+++ b/py/stream/pyproject.toml@@ -4,7 +4,7 @@ build-backend = "poetry.core.masonry.api"[tool.poetry]name = "crayonai_stream"-version = "0.6.1"+version = "0.6.2"description = "Streaming utilities for CrayonAI"authors = ["Thesys Inc. <[email protected]>"]readme = "README.md"diff --git a/py/stream/setup.py b/py/stream/setup.pyindex 41d2687cf..85493cb64 100644--- a/py/stream/setup.py+++ b/py/stream/setup.py@@ -2,7 +2,7 @@ from setuptools import setup, find_packagessetup(name="crayonai_stream",- version="0.6.1",+ version="0.6.2",description="Streaming utilities for CrayonAI",author="CrayonAI",packages=find_packages(where="src"),diff --git a/py/stream/src/crayonai_stream/protocol.py b/py/stream/src/crayonai_stream/protocol.pyindex 500a80aa4..cc8ce10d4 100644--- a/py/stream/src/crayonai_stream/protocol.py+++ b/py/stream/src/crayonai_stream/protocol.py@@ -28,7 +28,7 @@ class TextChunk(Chunk):chunk: strdef toSSEString(self) -> str:- return encode_sse(SSEType.TextDelta, self.chunk)+ return encode_sse(SSEType.TextDelta.value, self.chunk)class ResponseTemplate(Chunk):@@ -37,32 +37,32 @@ class ResponseTemplate(Chunk):def toSSEString(self) -> str:data = {"name": self.name, "templateProps": self.templateProps}- return encode_json_sse(SSEType.ResponseTemplate, data)+ return encode_json_sse(SSEType.ResponseTemplate.value, data)class ResponseTemplatePropsChunk(Chunk):chunk: strdef toSSEString(self) -> str:- return encode_sse(SSEType.ResponseTemplatePropsChunk, self.chunk)+ return encode_sse(SSEType.ResponseTemplatePropsChunk.value, self.chunk)class ContextUpdate(Chunk):contextItem: JSONValuedef toSSEString(self) -> str:- return encode_json_sse(SSEType.ContextAppend, self.contextItem)+ return encode_json_sse(SSEType.ContextAppend.value, self.contextItem)class MessageUpdate(Chunk):id: strdef toSSEString(self) -> str:- return encode_json_sse(SSEType.MessageUpdate, {"id": self.id})+ return encode_json_sse(SSEType.MessageUpdate.value, {"id": self.id})class Error(Chunk):error: strdef toSSEString(self) -> str:- return encode_sse(SSEType.Error, self.error)+ return encode_sse(SSEType.Error.value, self.error)