Skip to content

[PRE-417] Use field alias to avoid Pydantic schema shadow warning - #22

Merged
joshgillies merged 1 commit into
mainfrom
pre-417-review-core-sdks-to-see-if-there-are-any-methods-missing
Aug 4, 2026
Merged

[PRE-417] Use field alias to avoid Pydantic schema shadow warning#22
joshgillies merged 1 commit into
mainfrom
pre-417-review-core-sdks-to-see-if-there-are-any-methods-missing

Conversation

@joshgillies

@joshgillies joshgillies commented Aug 4, 2026

Copy link
Copy Markdown
Collaborator

QualitySchemaForCreate and QualitySchemaDetails use schema_ as the field name with an alias of 'schema' so the API JSON payload stays unchanged. populate_by_name=True lets callers construct models with either schema or schema_.

Also bumps ty from 0.0.29 to 0.0.66 to support Field(alias=...) type checking.

Summary by CodeRabbit

  • Documentation

    • Updated setup instructions and integration examples to use the current Prefactor API URL across supported packages.
    • Refreshed endpoint examples for core, HTTP, LangChain, and LiveKit integrations.
  • Improvements

    • Quality schema models now provide a Python-safe field name while remaining compatible with the external schema format.
    • Expanded validation coverage for agent instances, spans, statuses, and schema input formats.

QualitySchemaForCreate and QualitySchemaDetails use schema_ as the
field name with an alias of 'schema' so the API JSON payload stays
unchanged. populate_by_name=True lets callers construct models with
either schema or schema_.

Also bumps ty from 0.0.29 to 0.0.66 to support Field(alias=...) type
checking.
@coderabbitai

coderabbitai Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: f9748382-17b7-4d5e-8ad4-01b69bc78a4f

📥 Commits

Reviewing files that changed from the base of the PR and between b4c72dc and 627aeaa.

⛔ Files ignored due to path filters (1)
  • uv.lock is excluded by !**/*.lock
📒 Files selected for processing (14)
  • README.md
  • packages/core/README.md
  • packages/core/examples/agent_e2e.py
  • packages/http/README.md
  • packages/http/src/prefactor_http/__init__.py
  • packages/http/src/prefactor_http/config.py
  • packages/http/src/prefactor_http/models/agent_instance.py
  • packages/http/tests/test_models.py
  • packages/langchain/README.md
  • packages/langchain/examples/README.md
  • packages/langchain/examples/simple_agent.py
  • packages/langchain/src/prefactor_langchain/middleware.py
  • packages/livekit/README.md
  • pyproject.toml

📝 Walkthrough

Walkthrough

The PR updates Prefactor API URLs across documentation and examples, renames quality schema model attributes to schema_ with a schema alias, expands HTTP model tests, and upgrades the pinned ty development dependency.

Changes

API URL updates

Layer / File(s) Summary
Documented API URL migration
README.md, packages/core/..., packages/http/..., packages/langchain/..., packages/livekit/README.md
Examples, configuration guidance, and default URL values now use https://app.prefactorai.com.

Quality schema model compatibility

Layer / File(s) Summary
Quality schema alias contract
packages/http/src/prefactor_http/models/agent_instance.py
Quality schema models expose schema_ and accept the external schema alias.
Model validation coverage
packages/http/tests/test_models.py
Tests cover aliased schema input, current AgentSpan fields, AgentInstance purposes, statuses, and termination fields.

Development tooling update

Layer / File(s) Summary
Pinned ty version update
pyproject.toml
The pinned ty version changes from 0.0.29 to 0.0.66.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

Suggested reviewers: siutan

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the main change: using a Pydantic field alias to avoid the schema shadow warning.
Docstring Coverage ✅ Passed Docstring coverage is 86.67% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch pre-417-review-core-sdks-to-see-if-there-are-any-methods-missing

Comment @coderabbitai help to get the list of available commands.

@joshgillies
joshgillies marked this pull request as ready for review August 4, 2026 04:10
@joshgillies
joshgillies merged commit f00480f into main Aug 4, 2026
12 checks passed
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.

1 participant