From 973189300e9e11dc431dd14db04ce63978ae64a3 Mon Sep 17 00:00:00 2001 From: goulustis Date: Wed, 15 Oct 2025 16:24:59 +0800 Subject: [PATCH] add chat --- lang_agent/pipeline.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/lang_agent/pipeline.py b/lang_agent/pipeline.py index 6d50236..e11e220 100644 --- a/lang_agent/pipeline.py +++ b/lang_agent/pipeline.py @@ -108,5 +108,15 @@ class Pipeline: def get_ws_url(self): return f"ws://{self.config.host}:{self.config.port}" + def chat(self, inp:str): + inp = {"messages":[HumanMessage(inp)]}, {"configurable": {"thread_id": 3}} + + out = self.invoke(*inp) + return out['messages'][-1].content +if __name__ == "__main__": + pipeline:Pipeline = PipelineConfig().setup() + + print(pipeline.chat("I'm steve")) + print(pipeline.chat("what is my name?")) \ No newline at end of file