mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-29 01:42:19 +00:00
fix(interactions): only set object/id/delta on step.stop for legacy schema
StepStop (new schema) has no object, id, or delta fields. Setting them unconditionally caused spec-breaking extra fields on new-schema step.stop events in all four construction sites (sync/async × main-loop/StopIteration). Legacy content.stop still receives id, object, and delta unchanged. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
parent
302069ca0e
commit
1737787233
1 changed files with 6 additions and 6 deletions
|
|
@ -244,10 +244,10 @@ class LiteLLMResponsesInteractionsStreamingIterator:
|
|||
stop_kwargs: Dict[str, Any] = {
|
||||
"event_type": stop_event_type,
|
||||
"index": 0,
|
||||
"id": transformed.id,
|
||||
"object": "content",
|
||||
}
|
||||
if self._use_legacy:
|
||||
stop_kwargs["id"] = transformed.id
|
||||
stop_kwargs["object"] = "content"
|
||||
stop_kwargs["delta"] = {
|
||||
"type": "text",
|
||||
"text": self.collected_text,
|
||||
|
|
@ -270,9 +270,9 @@ class LiteLLMResponsesInteractionsStreamingIterator:
|
|||
stop_kwargs = {
|
||||
"event_type": stop_event_type,
|
||||
"index": 0,
|
||||
"object": "content",
|
||||
}
|
||||
if self._use_legacy:
|
||||
stop_kwargs["object"] = "content"
|
||||
stop_kwargs["delta"] = {
|
||||
"type": "text",
|
||||
"text": self.collected_text,
|
||||
|
|
@ -330,10 +330,10 @@ class LiteLLMResponsesInteractionsStreamingIterator:
|
|||
stop_kwargs_async: Dict[str, Any] = {
|
||||
"event_type": stop_event_type,
|
||||
"index": 0,
|
||||
"id": transformed.id,
|
||||
"object": "content",
|
||||
}
|
||||
if self._use_legacy:
|
||||
stop_kwargs_async["id"] = transformed.id
|
||||
stop_kwargs_async["object"] = "content"
|
||||
stop_kwargs_async["delta"] = {
|
||||
"type": "text",
|
||||
"text": self.collected_text,
|
||||
|
|
@ -358,9 +358,9 @@ class LiteLLMResponsesInteractionsStreamingIterator:
|
|||
stop_kwargs_async = {
|
||||
"event_type": stop_event_type,
|
||||
"index": 0,
|
||||
"object": "content",
|
||||
}
|
||||
if self._use_legacy:
|
||||
stop_kwargs_async["object"] = "content"
|
||||
stop_kwargs_async["delta"] = {
|
||||
"type": "text",
|
||||
"text": self.collected_text,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue