Currently, only chunks related to Choice class are logged.
|
def send_chunk(self, chunk: BaseChunk) -> None: |
|
log_debug("chunk: " + json.dumps(chunk.to_dict())) |
|
self._queue.put_nowait(chunk) |
We need to extend this logging logic uniformly to all kinds of chunks in general so that the debug log shows every single chunk sent to the response stream.
Keep in mind that in the streaming mode we don't need these chunk: logs at all since all the streaming chunks are already logged in this method:
|
def _format_chunk(data: Union[dict, str]) -> str: |
|
data = "data: " + ( |
|
json.dumps(data, separators=(",", ":")) |
|
if isinstance(data, dict) |
|
else data |
|
) |
|
log_debug(data) |
|
return f"{data}\n\n" |
Currently, only chunks related to
Choiceclass are logged.ai-dial-sdk/aidial_sdk/chat_completion/choice.py
Lines 67 to 69 in 4278c10
We need to extend this logging logic uniformly to all kinds of chunks in general so that the debug log shows every single chunk sent to the response stream.
Keep in mind that in the streaming mode we don't need these
chunk:logs at all since all the streaming chunks are already logged in this method:ai-dial-sdk/aidial_sdk/utils/streaming.py
Lines 38 to 45 in 4278c10