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

Complex examples #36

Open
3 of 12 tasks
jkomoros opened this issue Jul 4, 2023 · 1 comment
Open
3 of 12 tasks

Complex examples #36

jkomoros opened this issue Jul 4, 2023 · 1 comment

Comments

@jkomoros
Copy link
Owner

jkomoros commented Jul 4, 2023

  • Move current examples to example-simple.json
  • Create example-complex.json
  • An example that prompts for name and then returns it.
  • An example where it prompts for favorite things until a user gives '' (unless there are already some things) and then writes a limerick about the favorite things.
  • Favorite things limerick should allow a user to put in more things even if they already have a few.
  • Favorte things limterick should also include the user's name.
  • Remove unnecessary lets in the example-complex.json seeds
  • Generalize prompt-name into a meta-seed, where it takes the string to show to the user in the prompt, the location to store the value in.
  • Have a method to return all embedding models that have keys, all completion models, and all providers that have keys set
  • Have a seed that takes another seed and runs it on different llm providers and keeps track of answers
  • Have a seed that is told to look at a prompt and figure out inputs that might break the prompt
  • Add utility.json seed packet of convenence methods for things like prompt-var

See also #11.
Test

jkomoros added a commit that referenced this issue Jul 4, 2023
Part of #11. Part of #36.
@jkomoros
Copy link
Owner Author

jkomoros commented Jul 4, 2023

Friction log for working on prompt-name

  • Boy is it annoying to write in JSON, even with schema completion!
  • It's really confusing when to use var vs retrieve, and how to do the naming scheme.
  • It feels weird to have a prefix for var but not for store (and also store really should

things to do to improve it:

  • Allow let to take a map of properties and values to set at once (so you can set store iwthin sub-expressions)
  • Allow template to directly fetch things from env and store (e.g. @store(_default_store:komoroske.com:value) (it gets funky because variable names might have weird characters in them and it needs to be another delimiter))
  • name vs key in let and store is weird, they feel like they should be the same
  • store.key --> store.name
  • var and retrieve should have else clauses. If the value is not set (is undefined) then the else clause is evaluated and returned instead. This allows a pattern where you can request-or-calculate-and-store the value. (use it in complex examples)
  • Update examples-complex.json to use the retrieve/else behavior
  • Should var have an optional default that is retrurned if the var is not bound?
  • Prompt should be able to take an optional model argument, just like other ones can now be passed a model or get it from environment
  • Should there be a entrypoints in seed packet that describe the usage of different named entrypoints (and which ones are SUPPOSED to be used, vs internals?). Then the CLI could show entrypoints mainly
  • Add a comment field. description is used for external facing behavior, comment is used for internal notes to self or people reading the code, and never shows anywhere
  • verbose log should have an amount of indents tied to how nested it is.
  • addition, substraction, deletion, multiplication seed types
  • slice, shuffle array operations
  • does array.length operation work using property seed_type already?
  • Tooling to detect invalid refs to local seeds after unrolling
  • It would be less annoying to type if sub-seeds didn't ened a "type", but could be determined from the precense of which keys they had (taking care to design it so each seed as at least one distinctive property). But then that would make the detection of if a value is a sub-seed or not way harder (currently it's just hte precense of 'type').
  • should let.name ==> let.var?
  • typing komoroske.com prefix a million times gets repetitive, maybe have a prefix property in seed packet that will be auto-expanded when seeds unrolled? Add a var_prefix environment variable that adds it if it's not a known key and doesn't have a prefix already.
  • Add a vars at top level of seed packet that basically adds a let-multi seed in front of every top one
  • should recall take an optional create: boolean and only create the store if it's passed? That way you can do a probe check for memories without erroring, but in the common case where you just had a typo you don't have to wory about it
  • write-favorire-things-limerick and favorite-things-limerick have to do a lot of duplication of setting memory and the recalled memories, because each might be run as an entrypoint. Are there ways to de-duplicate them? For example, what if the seed packet was allowed to set an evironment overlay for all seeds in the packet?
  • Could we get rid of type:object and just have it search through keys and find any that were seed-reference-like?
  • is id distinctive enough in a seed reference? should it be seed?
  • There should be a way to delete a memory as a command (needs approval)
  • array should be able to return its last item (then use it for the block where we store

jkomoros added a commit that referenced this issue Jul 4, 2023
Just working this example shows a lot of places where things can be improved.

Part of #36.
jkomoros added a commit that referenced this issue Jul 4, 2023
jkomoros added a commit that referenced this issue Jul 4, 2023
jkomoros added a commit that referenced this issue Jul 4, 2023
…ere it sets the value works properly.

Before it returned an array, making `prompt-name` not useful as a sub-expression, because sometimes it returns the name, and sometimes it returns an array.

Part of #36.
jkomoros added a commit that referenced this issue Jul 4, 2023
jkomoros added a commit that referenced this issue Jul 4, 2023
Like let, but it allows setting multiple values at once.

Part of #18. Part of #36.
jkomoros added a commit that referenced this issue Jul 4, 2023
This allows `let-multi` to be used to set environment variables that have a prefix, as is convention.

Part of #36.
jkomoros added a commit that referenced this issue Jul 4, 2023
jkomoros added a commit that referenced this issue Jul 4, 2023
Without this, you could havea a let-multi that used a key of "komoroske.com:user_first_name" (as it's supposed to) but that's not a valid seed ID.

Should have been fixed in a925bdb

Part of #18. Part of #36.
jkomoros added a commit that referenced this issue Jul 4, 2023
jkomoros added a commit that referenced this issue Jul 4, 2023
safeName is more restrictive than safeFileName, which is probably better to avoid getting weird names in weird places.

Part of #36.
jkomoros added a commit that referenced this issue Jul 4, 2023
jkomoros added a commit that referenced this issue Jul 4, 2023
jkomoros added a commit that referenced this issue Jul 4, 2023
…ff `compose`.

It uses the memories stored via `remember-favorite-things`.

Part of #36.
jkomoros added a commit that referenced this issue Jul 4, 2023
This allows use cases like getting integer keys from an array and also `length`.

It's a bit squishy but, whatever! It's useful.

Part of #36.
jkomoros added a commit that referenced this issue Jul 4, 2023
…fail.

This allows the pattern of first testing to see if there are any memories stored before trying to store some.

Part of #36.
jkomoros added a commit that referenced this issue Jul 4, 2023
…ries if you haven't stored any yet.

Part of #36.
jkomoros added a commit that referenced this issue Jul 4, 2023
jkomoros added a commit that referenced this issue Jul 4, 2023
Part of #36. Part of #11.
jkomoros added a commit that referenced this issue Jul 4, 2023
jkomoros added a commit that referenced this issue Jul 4, 2023
jkomoros added a commit that referenced this issue Jul 5, 2023
Part of #36. Related to the best practice in #40.
jkomoros added a commit that referenced this issue Jul 7, 2023
jkomoros added a commit that referenced this issue Jul 7, 2023
This makes seed references more obviously seed references.

This was noted as an improvement in #36. It will also make #42 easier to do, because then the only
disallowed key names will be "type" and "seed".
jkomoros added a commit that referenced this issue Jul 8, 2023
jkomoros added a commit that referenced this issue Jul 8, 2023
jkomoros added a commit that referenced this issue Jul 8, 2023
jkomoros added a commit that referenced this issue Jul 8, 2023
jkomoros added a commit that referenced this issue Jul 8, 2023
Should have been part of 7e42ce5.

Part of #36.
jkomoros added a commit that referenced this issue Jul 8, 2023
Schema type checking has started failing with #42 I think, because this problem wasn't detected but should have been.

Part of #36.
jkomoros added a commit that referenced this issue Jul 8, 2023
jkomoros added a commit that referenced this issue Jul 9, 2023
If the named variable isn't set, then (and only then) an else clause is executed to return a value.

This is useful for defaults, but also for sub-expressions where it only does things like prompting the user if the value isn't set.

Part of #36.
jkomoros added a commit that referenced this issue Jul 10, 2023
Description is for information about what a seed does to others; comment is an internal implementation
description that isn't shown to users.

Part of #36.
jkomoros added a commit that referenced this issue Jul 10, 2023
jkomoros added a commit that referenced this issue Jul 30, 2023
This is considerably less annoying to type, given that you have to type it CONSTANTLY.

Part of #36.
jkomoros added a commit that referenced this issue Jul 30, 2023
It's no longer necessary now that we have `function`.

Part of #20. Part of #36.
jkomoros added a commit that referenced this issue Jul 30, 2023
jkomoros added a commit that referenced this issue Aug 12, 2023
Basically a manual revert of 342ccf6

It was weird that "t" was the only property that wasn't typed out. And with improvements in #7 and #6 it's not as necessary.

Part of #36.
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

No branches or pull requests

1 participant