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

[breaking change] Do not use Mustache but SpringBoot like references to refer to secrets and globals #507

Merged
merged 7 commits into from
Oct 2, 2023

Conversation

eolivelli
Copy link
Member

@eolivelli eolivelli commented Oct 2, 2023

Problems statement:

  1. We using Mustache both for resolving variables (secrets and globals) and for templating of Prompts and Queries.
    This nesting of Mustache templates is really awkward and the use must use a strange '{{%' syntax in Prompts and Queries.
  2. Mustache only produces strings, and it cannot return maps or lists, so you cannot use global variables for lists or maps
  3. you must use the triple curly braces in order to not escape the values ({{{secrets.password}}} works, {{secrets.password}} sometimes doesn't work)

Modifications:

  • Drop Mustache from the preprocessor, let's use a StringBoot like syntax ${secrets.x.y.z} and ${globals.x.y.z}
  • Change all the examples to use the new syntax

@@ -400,7 +400,7 @@ private ApplicationCustomResource createAppWithResources(
metadata:
name: %s
spec:
application: '{"agentRunners": {"agent1": {"resources": {"size": %d, "parallelism": %d}}}}'
application: '{"agentRunners": {"agent1": {"resources": {"size": %d, "parallelism": %d}}'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is unrelated

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

@@ -124,7 +124,7 @@ private ApplicationCustomResource createApp(String tenant, int size, int paralle
name: %s
namespace: %s
spec:
application: '{"agentRunners": {"agent1": {"resources": {"size": %d, "parallelism": %d}}}}'
application: '{"agentRunners": {"agent1": {"resources": {"size": %d, "parallelism": %d}}'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unrelated

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

@eolivelli eolivelli requested a review from nicoloboschi October 2, 2023 13:52
@eolivelli eolivelli marked this pull request as ready for review October 2, 2023 14:19
@eolivelli eolivelli merged commit 07425de into main Oct 2, 2023
8 checks passed
@eolivelli eolivelli deleted the impl/drop-mustache branch October 2, 2023 14:19
benfrank241 pushed a commit to vectorize-io/langstream that referenced this pull request May 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants