add toolnode abc

This commit is contained in:
2025-12-12 16:50:14 +08:00
parent 7d39e5f3f8
commit 069d15d254

View File

@@ -1,4 +1,4 @@
from typing import List, Callable, Tuple
from typing import List, Callable, Tuple, Dict
from abc import ABC, abstractmethod
from PIL import Image
from io import BytesIO
@@ -6,6 +6,7 @@ import matplotlib.pyplot as plt
from loguru import logger
from langgraph.graph.state import CompiledStateGraph
from langchain_core.messages import BaseMessage
class LangToolBase(ABC):
@@ -54,4 +55,8 @@ class ToolNodeBase(GraphBase):
returns 2 words, one for starting delayed yeilding, the other for ending delayed yielding,
they should be of format ('[key1]', '[key2]'); key1 is starting, key2 is ending
"""
return None, None
return None, None
@abstractmethod
def invoke(self, inp)->Dict[str, List[BaseMessage]]:
pass