Skip to content

Commit 88af75c

Browse files
committed
fix missing set memory
1 parent 484cb9c commit 88af75c

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

python/llama-index-server/examples/artifact/code_workflow.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
import time
33
from typing import Any, Literal, Optional, Union
44

5-
from pydantic import BaseModel
6-
75
from llama_index.core.chat_engine.types import ChatMessage
86
from llama_index.core.llms import LLM
97
from llama_index.core.memory import ChatMemoryBuffer
@@ -24,6 +22,7 @@
2422
UIEvent,
2523
)
2624
from llama_index.server.api.utils import get_last_artifact
25+
from pydantic import BaseModel
2726

2827

2928
class Requirement(BaseModel):
@@ -215,6 +214,7 @@ async def planning(
215214
content=f"The plan for next step: \n{response.text}",
216215
)
217216
)
217+
await ctx.set("memory", memory)
218218
if requirement.next_step == "coding":
219219
return GenerateArtifactEvent(
220220
requirement=requirement,

python/llama-index-server/examples/artifact/document_workflow.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
import time
33
from typing import Any, Literal, Optional
44

5-
from pydantic import BaseModel
6-
75
from llama_index.core.chat_engine.types import ChatMessage
86
from llama_index.core.llms import LLM
97
from llama_index.core.memory import ChatMemoryBuffer
@@ -24,6 +22,7 @@
2422
UIEvent,
2523
)
2624
from llama_index.server.api.utils import get_last_artifact
25+
from pydantic import BaseModel
2726

2827

2928
class DocumentRequirement(BaseModel):
@@ -188,6 +187,7 @@ async def planning(self, ctx: Context, event: PlanEvent) -> GenerateArtifactEven
188187
content=f"Planning for the document generation: \n{response.text}",
189188
)
190189
)
190+
await ctx.set("memory", memory)
191191
ctx.write_event_to_stream(
192192
UIEvent(
193193
type="ui_event",

0 commit comments

Comments
 (0)