Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ class PromptTemplate:
def __init__(self, template_path: str):
self.env = jinja2.Environment(
loader=jinja2.FileSystemLoader(Path(__file__).parent / "templates"),
autoescape=jinja2.select_autoescape(["html", "xml"]),
trim_blocks=True,
lstrip_blocks=True,
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import sys
from pathlib import Path
from typing import Dict, Any
from jinja2 import Environment, FileSystemLoader
from jinja2 import Environment, FileSystemLoader, select_autoescape

from agent_framework.agent import Agent
from agent_framework.state import AgentState
Expand Down Expand Up @@ -90,7 +90,12 @@ def __init__(self, agent_id: str = "weather_vibes"):

# Set up template environment
template_dir = Path(__file__).parent.parent / "templates"
self.template_env = Environment(loader=FileSystemLoader(template_dir), trim_blocks=True, lstrip_blocks=True)
self.template_env = Environment(
loader=FileSystemLoader(template_dir),
autoescape=select_autoescape(["html", "xml"]),
trim_blocks=True,
lstrip_blocks=True,
)

# Set up OpenAI client instead of OpenAIChat
self.client = OpenAI(api_key=os.getenv("OPENAI_API_KEY"))
Expand Down
Loading