Skip to content

Commit

Permalink
backend: store the text user selected as interesting snippet
Browse files Browse the repository at this point in the history
  • Loading branch information
nikromen committed Mar 26, 2024
1 parent a36e8e8 commit 72fdd81
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 4 deletions.
1 change: 1 addition & 0 deletions backend/src/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ class SnippetSchema(BaseModel):
start_index: int
end_index: int
user_comment: str
text: str

# def _splitter(self, return_lines: bool) -> tuple[int, int]:
# fst, snd = self.log_part.split("-")
Expand Down
28 changes: 24 additions & 4 deletions backend/tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,12 @@ def spec_feedback_input_output_schema_tuple():
"name": "log1",
"content": "log content 1",
"snippets": [
{"start_index": 1, "end_index": 2, "user_comment": "comment1"}
{
"start_index": 1,
"end_index": 2,
"user_comment": "comment1",
"text": "log content 1",
}
],
},
],
Expand All @@ -132,7 +137,12 @@ def spec_feedback_input_output_schema_tuple():
"name": "log1",
"content": "log content 1",
"snippets": [
{"start_index": 1, "end_index": 2, "user_comment": "comment1"}
{
"start_index": 1,
"end_index": 2,
"user_comment": "comment1",
"text": "log content 1",
}
],
}
},
Expand All @@ -151,7 +161,12 @@ def container_feedback_input_output_schema_tuple():
"name": "log1",
"content": "log content 1",
"snippets": [
{"start_index": 1, "end_index": 2, "user_comment": "comment1"}
{
"start_index": 1,
"end_index": 2,
"user_comment": "comment1",
"text": "log content 1",
}
],
},
],
Expand All @@ -168,7 +183,12 @@ def container_feedback_input_output_schema_tuple():
"name": "log1",
"content": "log content 1",
"snippets": [
{"start_index": 1, "end_index": 2, "user_comment": "comment1"}
{
"start_index": 1,
"end_index": 2,
"user_comment": "comment1",
"text": "log content 1",
}
],
}
},
Expand Down

0 comments on commit 72fdd81

Please sign in to comment.