-
Notifications
You must be signed in to change notification settings - Fork 203
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: make the KV store configurable via env vars #391
Conversation
@step() | ||
async def run_step(self, ev: StartEvent) -> StopEvent: | ||
message = str(ev.get("message", "")) | ||
return StopEvent(result=f"Message received: {message}") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe a better example would be something that keeps state/context between runs? Like a counter?
@step() | ||
async def run_step(self, ctx: Context, ev: StartEvent) -> StopEvent: | ||
amount = float(ev.get("amount", 0.0)) | ||
total = await ctx.get("total", 0.0) + amount |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
An await and + without brackets works? TIL :D
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You made me curious :) indeed await
is pretty high in the order of precedence, right after call() https://docs.python.org/3/reference/expressions.html#operator-precedence
Fixes #370
Allow passing a URI string to the control plane constructor to build a KV store. For now only Redis and MongoDB are supported, to be considered reference implementation. Ideally we could support all the available store in llama_index.