Skip to content

armgit / txtai

Public Imported from GitHub
0

💡 All-in-one AI framework for semantic search, LLM orchestration and language model workflows

Fix issue with latest version of smolagents, closes #913

davidmezzetti24b0b7ceca9c
diff --git a/setup.py b/setup.py
index ca2ca4dd..51e73eee 100644
--- a/setup.py
+++ b/setup.py
@@ -27,7 +27,7 @@ extras["dev"] = [
"pylint",
]
-extras["agent"] = ["mcpadapt>=0.1.0", "smolagents>=1.15"]
+extras["agent"] = ["mcpadapt>=0.1.0", "smolagents>=1.17"]
extras["ann"] = [
"annoy>=1.16.3",
diff --git a/src/python/txtai/agent/model.py b/src/python/txtai/agent/model.py
index 6a0be221..810636c5 100644
--- a/src/python/txtai/agent/model.py
+++ b/src/python/txtai/agent/model.py
@@ -36,13 +36,16 @@ class PipelineModel(Model):
# Call parent constructor
super().__init__(flatten_messages_as_text=not self.llm.isvision(), **kwargs)
- def __call__(self, messages, stop_sequences=None, grammar=None, tools_to_call_from=None, **kwargs):
+ # pylint: disable=W0613
+ def generate(self, messages, stop_sequences=None, response_format=None, tools_to_call_from=None, **kwargs):
"""
Runs LLM inference. This method signature must match the smolagents specification.
Args:
messages: list of messages to run
stop_sequences: optional list of stop sequences
+ response_format: response format to use in the model's response.
+ tools_to_call_from: list of tools that the model can use to generate responses.
kwargs: additional keyword arguments
Returns: