# Unify language model event stream handling \(\#63520\) · gitcafe/zed

[View on GitCafe](https://git.cafe/gitcafe/zed/commit/8514ce3ba1ee7a6786e35f6566c7cfeb3c42d3b7)

Repository: [gitcafe/zed](https://git.cafe/gitcafe/zed)

Visibility: public

Requested revision: 8514ce3ba1ee7a6786e35f6566c7cfeb3c42d3b7

Requested commit: 8514ce3ba1ee7a6786e35f6566c7cfeb3c42d3b7

Commit: 8514ce3ba1ee7a6786e35f6566c7cfeb3c42d3b7

Tree: 936cea8930661940c6ea8c76405b4a0b6f20368f

Author: Finn Evers

Committer: GitHub

## Message

```
Unify language model event stream handling (#63520)

Closes https://github.com/zed-industries/zed/issues/63314
Closes https://github.com/zed-industries/zed/issues/42584

Follow-up to https://github.com/zed-industries/zed/pull/62652

Removes a lot of duplicated code in favor of throwing it
into`language_core` as well as removing duplicate struct definitions
that were only different because of entirely unused fields.

Furthermore, improves error-messages so that these untagged enum errors
are no longer a thing in an effort to make this more maintainable in the
future.

Lastly, includes a small but nice improvement changing a `Value` to a
`RawValue` so that we don't have to clone for deserialization in that
specific case.

Release Notes:

- Improved streaming for OpenAI-compatible providers.

---------

Co-authored-by: Anant Goel <anant@zed.dev>
```

## Parents

- [c3cf80c0d1be43f3b84e21ef2c82e91b0d78e788](https://git.cafe/gitcafe/zed/commit/c3cf80c0d1be43f3b84e21ef2c82e91b0d78e788?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zed/tree/8514ce3ba1ee7a6786e35f6566c7cfeb3c42d3b7?format=markdown)
