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

annotation: annotate nested objects using jsonpath reference #395

Open
zilto opened this issue Oct 15, 2024 · 0 comments
Open

annotation: annotate nested objects using jsonpath reference #395

zilto opened this issue Oct 15, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@zilto
Copy link
Collaborator

zilto commented Oct 15, 2024

The recently released annotation feature allows to annotate top-level objects stored on State.

For example, if State had this schema (this is the result of all reads and writes defined via @action), we could only annotate the full list of paragraphs and `summaries.

class State:
  url: str
  credentials: dict
  paragraphs: list[str]
  summaries: list[str]

The challenge is how to link annotations to specific state values.

Proposed solution

Since state is immutable and we have the full object stored, we could store access paths for arbitrary Mapping and Sequence types (i.e., JSON-like). For example, you could annotate the 3rd paragraph by specifying State -> paragraphs -> index 2

Related: if paragraphs was a list of objects that have richer UI support (e.g., list[pydantic.BaseModel]), we could display them in rich format.

Adapting the annotation UI for easy navigation may be challenging

@zilto zilto added the enhancement New feature or request label Oct 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant