Skip to content

annotation: annotate nested objects using jsonpath reference #395

@zilto

Description

@zilto

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/coreApplication, State, Graph, Actionskind/featureNet-new functionalitypriority/lowNice-to-have, backlog

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions