Skip to content

Commit 8e38f1c

Browse files
committed
fix: 🐛 remove handle_plural_values feature
1 parent 2542cce commit 8e38f1c

2 files changed

Lines changed: 0 additions & 27 deletions

File tree

src/llm.py

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -83,39 +83,13 @@ def add_response_to_json(self, field: str, value: str):
8383
if value != "-1":
8484
parsed_value = value
8585

86-
if ";" in value:
87-
parsed_value = self.handle_plural_values(value)
88-
8986
if field in self._json.keys():
9087
self._json[field].append(parsed_value)
9188
else:
9289
self._json[field] = parsed_value
9390

9491
return
9592

96-
def handle_plural_values(self, plural_value: str):
97-
"""
98-
This method handles plural values.
99-
Takes in strings of the form 'value1; value2; value3; ...; valueN'
100-
returns a list with the respective values -> [value1, value2, value3, ..., valueN]
101-
"""
102-
if ";" not in plural_value:
103-
raise ValueError(
104-
f"Value is not plural, doesn't have ; separator, Value: {plural_value}"
105-
)
106-
107-
print(
108-
f"\t[LOG]: Formatting plural values for JSON, [For input {plural_value}]..."
109-
)
110-
values = plural_value.split(";")
111-
112-
# Remove trailing leading whitespace
113-
for i in range(len(values)):
114-
values[i] = values[i].lstrip()
115-
116-
print(f"\t[LOG]: Resulting formatted list of values: {values}")
117-
118-
return values
11993

12094
def get_data(self):
12195
return self._json

src/prompt.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ SYSTEM PROMPT:
22
You are an AI assistant designed to help fillout json files with information extracted from transcribed voice recordings.
33
You will receive the transcription, and the name of the JSON field whose value you have to identify in the context. Return
44
only a single string containing the identified value for the JSON field.
5-
If the field name is plural, and you identify more than one possible value in the text, return both separated by a ";".
65
If you don't identify the value in the provided text, return "-1".
76
---
87
DATA:

0 commit comments

Comments
 (0)