(
*,
chunk_id: str,
created: int,
model: str,
index: int,
delta: Dict[str, Any],
finish_reason: Optional[str],
logprobs: Optional[Dict[str, Any]] = None,
)
| 7586 | |
| 7587 | @staticmethod |
| 7588 | def _chat_chunk_payload( |
| 7589 | *, |
| 7590 | chunk_id: str, |
| 7591 | created: int, |
| 7592 | model: str, |
| 7593 | index: int, |
| 7594 | delta: Dict[str, Any], |
| 7595 | finish_reason: Optional[str], |
| 7596 | logprobs: Optional[Dict[str, Any]] = None, |
| 7597 | ) -> Dict[str, Any]: |
| 7598 | choice: Dict[str, Any] = { |
| 7599 | "index": index, |
| 7600 | "delta": delta, |
| 7601 | "finish_reason": finish_reason, |
| 7602 | } |
| 7603 | if logprobs is not None: |
| 7604 | choice["logprobs"] = logprobs |
| 7605 | return { |
| 7606 | "id": "chat" + chunk_id, |
| 7607 | "object": "chat.completion.chunk", |
| 7608 | "created": created, |
| 7609 | "model": model, |
| 7610 | "choices": [choice], |
| 7611 | } |
| 7612 | |
| 7613 | def _chunk_payloads( |
| 7614 | self, |
nothing calls this directly
no outgoing calls
no test coverage detected