Skip to content

chore: refactored state to pydantic #58#62

Open
atomao wants to merge 12 commits into
developmentfrom
refactor_state_pydantic
Open

chore: refactored state to pydantic #58#62
atomao wants to merge 12 commits into
developmentfrom
refactor_state_pydantic

Conversation

@atomao
Copy link
Copy Markdown
Contributor

@atomao atomao commented Dec 18, 2025

Applicable issues

Description of changes

  • Refactor state from dict to pydantic schema
  • add computed property any_tool_response_failed - used by eval framework

Checklist

By submitting this pull request, I confirm that my contribution is made under the terms of the MIT license.

@atomao atomao self-assigned this Dec 18, 2025
@atomao atomao requested a review from ypldan as a code owner December 18, 2025 13:53
@atomao atomao requested a review from navalnica December 18, 2025 14:19
@navalnica navalnica changed the title feat: refactored state to pydantic refactor: refactored state to pydantic Dec 19, 2025
@atomao
Copy link
Copy Markdown
Contributor Author

atomao commented Dec 19, 2025

/deploy-review

GitHub actions run: 20375016589
Environment URL: review-environment | pipeline

@atomao
Copy link
Copy Markdown
Contributor Author

atomao commented Dec 19, 2025

/deploy-review

GitHub actions run: 20376141816
Environment URL: review-environment | pipeline

@navalnica navalnica changed the title refactor: refactored state to pydantic chor: refactored state to pydantic Dec 19, 2025
@navalnica navalnica changed the title chor: refactored state to pydantic refactor: refactored state to pydantic Dec 19, 2025
@navalnica navalnica changed the title refactor: refactored state to pydantic chore: refactored state to pydantic Dec 19, 2025
@navalnica
Copy link
Copy Markdown
Contributor

navalnica commented Dec 19, 2025

/deploy-review

GitHub actions run: 20376994479
Environment URL: review-environment | pipeline

Comment thread statgpt/app/schemas/state.py Outdated
Comment thread statgpt/app/schemas/state.py Outdated
Comment thread statgpt/app/schemas/state.py Outdated
@navalnica
Copy link
Copy Markdown
Contributor

navalnica commented Jan 15, 2026

/deploy-review

GitHub actions run: 21031008311
Environment URL: review-environment | pipeline

direct_tool_calls: list[LangChainToolCall] = Field(default_factory=list)
tool_messages: list[StatGPTMessage] = Field(default_factory=list)

model_config = ConfigDict(validate_assignment=True, extra="forbid")
Copy link
Copy Markdown
Contributor

@navalnica navalnica Jan 15, 2026

Choose a reason for hiding this comment

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

using extra='forbid' could be a breaking change triggered on older existing conversations (they might have additional fields specified in the state). though I think this might be ok - we can add this to the "breaking changes" list on our next release.

however, it's a safer option for the future development

alternatively, we can set extra='ignore'. this is safer to existing conversations. but this might introduce bugs during future development

@Fedir-Yatsenko , what do you think?

@atomao atomao changed the title chore: refactored state to pydantic chore: refactored state to pydantic #58 Jan 16, 2026
@navalnica
Copy link
Copy Markdown
Contributor

navalnica commented Feb 3, 2026

/deploy-review

GitHub actions run: 21627708310

@navalnica
Copy link
Copy Markdown
Contributor

navalnica commented Feb 3, 2026

/deploy-review

GitHub actions run: 21630041984

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.

Refactor app state from dict to Pydantic model

2 participants