mirror of
https://github.com/ChrisSewell/DECEIVE.git
synced 2025-07-01 18:47:28 -04:00
Command output now logged as base64 string to avoid multiline issues.
This commit is contained in:
@ -10,6 +10,7 @@ from typing import Optional
|
|||||||
import logging
|
import logging
|
||||||
import datetime
|
import datetime
|
||||||
import uuid
|
import uuid
|
||||||
|
from base64 import b64encode
|
||||||
|
|
||||||
from langchain_openai import ChatOpenAI
|
from langchain_openai import ChatOpenAI
|
||||||
from langchain_core.messages import HumanMessage
|
from langchain_core.messages import HumanMessage
|
||||||
@ -41,7 +42,7 @@ async def handle_client(process: asyncssh.SSHServerProcess) -> None:
|
|||||||
)
|
)
|
||||||
|
|
||||||
process.stdout.write(f"{llm_response.content}")
|
process.stdout.write(f"{llm_response.content}")
|
||||||
logger.info(f"OUTPUT: {llm_response.content}")
|
logger.info(f"OUTPUT: {b64encode(llm_response.content.encode('ascii')).decode('ascii')}")
|
||||||
|
|
||||||
try:
|
try:
|
||||||
async for line in process.stdin:
|
async for line in process.stdin:
|
||||||
@ -63,7 +64,7 @@ async def handle_client(process: asyncssh.SSHServerProcess) -> None:
|
|||||||
)
|
)
|
||||||
|
|
||||||
process.stdout.write(f"{llm_response.content}")
|
process.stdout.write(f"{llm_response.content}")
|
||||||
logger.info(f"OUTPUT: {llm_response.content}")
|
logger.info(f"OUTPUT: {b64encode(llm_response.content.encode('ascii')).decode('ascii')}")
|
||||||
|
|
||||||
except asyncssh.BreakReceived:
|
except asyncssh.BreakReceived:
|
||||||
pass
|
pass
|
||||||
|
Reference in New Issue
Block a user