Skip to content

Commit 495893b

Browse files
committed
fix: raw content for view file tool
1 parent 8b969e6 commit 495893b

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/codegen/extensions/tools/view_file.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ class ViewFileObservation(Observation):
2222
content: str = Field(
2323
description="Content of the file",
2424
)
25+
raw_content: str = Field(
26+
description="Raw content of the file",
27+
)
2528
line_count: Optional[int] = Field(
2629
default=None,
2730
description="Number of lines in the file",
@@ -64,7 +67,7 @@ def render(self, tool_call_id: str) -> ToolMessage:
6467
"filepath": self.filepath,
6568
"start_line": self.start_line,
6669
"end_line": self.end_line,
67-
"content": self.content,
70+
"content": self.raw_content,
6871
"total_lines": self.line_count,
6972
"has_more": self.has_more,
7073
"max_lines_per_page": self.max_lines_per_page,
@@ -173,6 +176,7 @@ def view_file(
173176
status="success",
174177
filepath=file.filepath,
175178
content=content,
179+
raw_content=file.content,
176180
line_count=total_lines,
177181
)
178182

0 commit comments

Comments
 (0)