Skip to content
This repository was archived by the owner on Jul 3, 2025. It is now read-only.

Commit aab9e8a

Browse files
authored
Merge pull request #22 from lmnr-ai/dev
Dev
2 parents 0e000ac + 3b33c3a commit aab9e8a

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

index/agent/agent.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,12 @@ async def _generate_action(self, input_messages: list[Message]) -> AgentLLMOutpu
119119
# if we couldn't find the <output> tags, it most likely means the <output> tags are not present in the response
120120
json_str = response.content.replace("<output>", "").replace("</output>", "").strip()
121121
else:
122-
json_str = match.group(1).replace("<output>", "").replace("</output>", "").strip()
122+
# Extract just the content between the tags without any additional replacement
123+
json_str = match.group(1).strip()
124+
125+
# Ensure any trailing closing tags are removed (additional safety check)
126+
closing_tag_pattern = r"</output(?:[^>]*)>$"
127+
json_str = re.sub(closing_tag_pattern, "", json_str).strip()
123128

124129
try:
125130
# First try to parse it directly to catch any obvious JSON issues
@@ -276,7 +281,8 @@ async def run_stream(self,
276281
else:
277282
trace_id = None
278283

279-
await self._setup_messages(prompt, agent_state)
284+
with use_span(span):
285+
await self._setup_messages(prompt, agent_state)
280286

281287
step = prev_step if prev_step is not None else 0
282288
result = prev_action_result

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ packages = ["index"]
1010

1111
[project]
1212
name = "lmnr-index"
13-
version = "0.1.2"
13+
version = "0.1.3"
1414
description = "Index - SOTA browser AI agent for autonomous task execution on the web"
1515
readme = "README.md"
1616
requires-python = ">=3.10"

0 commit comments

Comments
 (0)