💡 All-in-one AI framework for semantic search, LLM orchestration and language model workflows
Python agentsaiai-agentsembeddingsinformation-retrievallanguage-modellarge-language-modelsllmnlppythonragretrieval-augmented-generationsearchsearch-enginesemantic-searchsentence-embeddingstransformerstxtaivector-databasevector-search
Limit template scope with Agents, closes #1080
davidmezzettifbce87b9eeca
diff --git a/src/python/txtai/agent/base.py b/src/python/txtai/agent/base.pyindex 31412957..23463db9 100644--- a/src/python/txtai/agent/base.py+++ b/src/python/txtai/agent/base.py@@ -6,7 +6,7 @@ import osfrom collections import deque-from jinja2 import Template+from jinja2.sandbox import SandboxedEnvironmentfrom .factory import ProcessFactory@@ -50,7 +50,7 @@ class Agent:self.window = memory# Create template- self.template = Template(+ self.template = SandboxedEnvironment().from_string(templateif templateelse """{{ text }}