|
|
@ -12,6 +12,7 @@ from typing import (
|
|
|
|
Mapping,
|
|
|
|
Mapping,
|
|
|
|
Optional,
|
|
|
|
Optional,
|
|
|
|
Tuple,
|
|
|
|
Tuple,
|
|
|
|
|
|
|
|
Type,
|
|
|
|
Union,
|
|
|
|
Union,
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
@ -91,7 +92,7 @@ async def acompletion_with_retry(llm: JinaChat, **kwargs: Any) -> Any:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def _convert_delta_to_message_chunk(
|
|
|
|
def _convert_delta_to_message_chunk(
|
|
|
|
_dict: Mapping[str, Any], default_class: type[BaseMessageChunk]
|
|
|
|
_dict: Mapping[str, Any], default_class: Type[BaseMessageChunk]
|
|
|
|
) -> BaseMessageChunk:
|
|
|
|
) -> BaseMessageChunk:
|
|
|
|
role = _dict.get("role")
|
|
|
|
role = _dict.get("role")
|
|
|
|
content = _dict.get("content") or ""
|
|
|
|
content = _dict.get("content") or ""
|
|
|
|