Skip to content
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

Merged
merged 8 commits into from
Nov 28, 2024
Merged

feat: make the KV store configurable via env vars #391

merged 8 commits into from
Nov 28, 2024

Conversation

masci
Copy link
Member

@masci masci commented Nov 27, 2024

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.

@coveralls
Copy link

coveralls commented Nov 27, 2024

Coverage Status

coverage: 72.985% (+0.8%) from 72.155%
when pulling 08b73e3 on massi/370
into 59ca6ce on main.

@masci masci marked this pull request as ready for review November 27, 2024 16:21
@step()
async def run_step(self, ev: StartEvent) -> StopEvent:
message = str(ev.get("message", ""))
return StopEvent(result=f"Message received: {message}")
Copy link
Collaborator

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
Copy link
Collaborator

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

Copy link
Member Author

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

@masci masci merged commit d396260 into main Nov 28, 2024
10 checks passed
@masci masci deleted the massi/370 branch November 28, 2024 16:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow to configure KV store in the control plane via URI
3 participants