diff --git a/ssh_server.py b/ssh_server.py index 2b73141..e426b80 100644 --- a/ssh_server.py +++ b/ssh_server.py @@ -1,6 +1,4 @@ -# To run this program, the file ``ssh_host_key`` must exist with an SSH -# private key in it to use as a server host key. An SSH host certificate -# can optionally be provided in the file ``ssh_host_key-cert.pub``. +#!/usr/bin/env python3 import asyncio import asyncssh @@ -17,10 +15,7 @@ from langchain_aws import ChatBedrock, ChatBedrockConverse from langchain_google_genai import ChatGoogleGenerativeAI from langchain_core.messages import HumanMessage -from langchain_core.chat_history import ( - BaseChatMessageHistory, - InMemoryChatMessageHistory, -) +from langchain_core.chat_history import BaseChatMessageHistory, InMemoryChatMessageHistory from langchain_core.runnables.history import RunnableWithMessageHistory from langchain_core.prompts import ChatPromptTemplate, MessagesPlaceholder from langchain_core.messages import SystemMessage, trim_messages @@ -30,6 +25,8 @@ from operator import itemgetter from configparser import ConfigParser + + async def handle_client(process: asyncssh.SSHServerProcess) -> None: # This is the main loop for handling SSH client connections. # Any user interaction should be done here.