tools fix and formatting (#2441)
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
from abc import ABC, abstractmethod
|
||||
from typing import Optional
|
||||
from typing import Dict, List, Optional
|
||||
|
||||
from mem0.configs.llms.base import BaseLlmConfig
|
||||
|
||||
@@ -17,12 +17,14 @@ class LLMBase(ABC):
|
||||
self.config = config
|
||||
|
||||
@abstractmethod
|
||||
def generate_response(self, messages):
|
||||
def generate_response(self, messages, tools: Optional[List[Dict]] = None, tool_choice: str = "auto"):
|
||||
"""
|
||||
Generate a response based on the given messages.
|
||||
|
||||
Args:
|
||||
messages (list): List of message dicts containing 'role' and 'content'.
|
||||
tools (list, optional): List of tools that the model can call. Defaults to None.
|
||||
tool_choice (str, optional): Tool choice method. Defaults to "auto".
|
||||
|
||||
Returns:
|
||||
str: The generated response.
|
||||
|
||||
Reference in New Issue
Block a user