Skip to content
This repository was archived by the owner on Jul 16, 2025. It is now read-only.

Conversation

chr-hertel
Copy link
Member

@chr-hertel chr-hertel commented Jul 4, 2025

I was just tired of doing those assert($response instanceof ...); statements
also resolves the special status of AsyncResponse by decoupling it from the ResponseInterface

WDYT?

Copy link

@smnandre smnandre left a comment

Choose a reason for hiding this comment

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

I like this very much... it does have its own drawbacks, but I feels it's by far the best way out of this situation, and it clarifies a lot of things on a DX level

@DZunke
Copy link
Contributor

DZunke commented Jul 5, 2025

This looks pretty cool! Thanks @chr-hertel - those assertions you mentioned are all over the place and this looks like a cool solution. Mostly one knows what kind of request was sent and what should be the response but for type safety checks where required. Wrapping those checks to the library with the ResponsePromise feels like a good step forward!

@chr-hertel chr-hertel force-pushed the refactor-platform-types branch from 77d71aa to 5471c77 Compare July 5, 2025 23:00
@chr-hertel chr-hertel marked this pull request as ready for review July 5, 2025 23:02
@chr-hertel chr-hertel force-pushed the refactor-platform-types branch from 5471c77 to b2e94eb Compare July 5, 2025 23:32
@chr-hertel
Copy link
Member Author

This PR demonstrates the benefits for lib users quite well I guess:
https://github.com/php-llm/llm-chain-symfony-demo/pull/29/files

@chr-hertel chr-hertel merged commit cb6fc83 into main Jul 6, 2025
7 checks passed
@chr-hertel chr-hertel deleted the refactor-platform-types branch July 6, 2025 17:56
chr-hertel added a commit to symfony/ai that referenced this pull request Jul 7, 2025
This PR was merged into the main branch.

Discussion
----------

refactor!: improve types in platform api

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | no
| Docs?         | no
| Issues        |
| License       | MIT

Cherry picking php-llm/llm-chain#376

Commits
-------

bfa7cd4 refactor!: improve types in platform api (#376)
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
BC BREAK Backwards compatibility break refactor
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants