Skip to content

Conversation

@jennifer-bowser
Copy link
Contributor

@jennifer-bowser jennifer-bowser commented Dec 18, 2025

The schema classes defined in src/anyvlm/schemas/vlm.py have 4 variables that we will be hard-coding to GREGoR-specific values for our MVP release. These can be divided into 2 groups:

  1. Metadata about the source the CAF data is coming from:

    • HandoverType.id
    • HandoverType.label
    • BeaconHandover.url
  2. Metadata about the AnyVLM node:

    • Meta.beaconId

Since our only data source for MVP will be GREGoR, hard-coding values for the items under Point Number 1 works for the time being. However, we'll ultimately need to pull these three values dynamically (since we'll be adding support for nodes to contain data from multiple sources post MVP - see Issue #37). I've therefore set these via environment variables for now in build_vlm_response_from_caf_data() for expediency, but have left #TODOs referencing the multi-cohort epic in the places where I'm using them.

The item under Point Number 2 (i.e. Meta.beaconId) should always be set once per node and should not change (even post-MVP). This one makes sense to leave an environment variable long-term, so I handled this differently by pulling the env var in at the class level and using Pydantic validation to ensure it's set.


⚠️ See the .env.example file for the new env var names and the GREGoR default values we'll use for our MVP release. You'll need to add these to your own .env file in order for tests to pass.

@jennifer-bowser jennifer-bowser self-assigned this Dec 18, 2025
@jennifer-bowser jennifer-bowser changed the title feat: enable config of node specific fields in vlm response (Issue #27) feat: enable config of node-specific fields in vlm response (Issue #27) Dec 18, 2025
@jennifer-bowser jennifer-bowser marked this pull request as ready for review December 18, 2025 18:32
@jennifer-bowser jennifer-bowser requested a review from a team December 18, 2025 18:32
@korikuzma
Copy link
Member

@jennifer-bowser could you try pulling in changes from main to see if it fixes CI?

model_config = ConfigDict(populate_by_name=True)


class MetaSettings(BaseSettings):
Copy link
Member

Choose a reason for hiding this comment

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

Any reason this is here and not in the config module?

Copy link
Contributor Author

@jennifer-bowser jennifer-bowser Dec 23, 2025

Choose a reason for hiding this comment

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

Because I couldn't figure out how to use the config module to pull the beaconId from environment variables in a way that would throw an error if it's not set while also preventing this field from ever being overriden, while also making sure typecheckers know that you're not supposed to pass in a value for beaconId when instantiating the class. I also wanted to keep the metadata associated with the description field for this.

I've tried a couple different things, but this is the best I was able to figure out. I don't really love it though, I'd very much be open to suggestions if you have any!

Copy link
Member

Choose a reason for hiding this comment

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

Hm... I am not sure I understand the tradeoffs, but it probably doesn't matter. I think we are likely in "merge and deal with it" territory

@jsstevenson jsstevenson self-requested a review December 23, 2025 19:40
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.

4 participants