Skip to content

Commit d30c5e6

Browse files
committed
fix: defer llm init in llamaindex scaffold template
1 parent dcdb9a1 commit d30c5e6

3 files changed

Lines changed: 7 additions & 3 deletions

File tree

packages/uipath-llamaindex/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "uipath-llamaindex"
3-
version = "0.5.14"
3+
version = "0.5.15"
44
description = "Python SDK that enables developers to build and deploy LlamaIndex agents to the UiPath Cloud Platform"
55
readme = { file = "README.md", content-type = "text/markdown" }
66
requires-python = ">=3.11"

packages/uipath-llamaindex/src/uipath_llamaindex/_cli/_templates/main.py.template

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
from functools import cached_property
2+
13
from llama_index.core.workflow import (
24
Event,
35
StartEvent,
@@ -22,7 +24,9 @@ class CritiqueEvent(StopEvent):
2224

2325

2426
class JokeFlow(Workflow):
25-
llm = OpenAI()
27+
@cached_property
28+
def llm(self) -> OpenAI:
29+
return OpenAI()
2630

2731
@step
2832
async def generate_joke(self, ev: TopicEvent) -> JokeEvent:

packages/uipath-llamaindex/uv.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)