Skip to content

Commit

Permalink
✨ feat(controller): add option to hide long text in tagger response
Browse files Browse the repository at this point in the history
Added `hidden_long_text` parameter to `tagger` method to control
the display of long text responses. Updated relevant method calls
to include the new parameter.
  • Loading branch information
sudoskys committed Sep 28, 2024
1 parent 5e20359 commit 668cc58
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion app/controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,20 @@ async def read_a111(file: BytesIO):
if not parameter:
raise Exception("Empty Parameter")
if isinstance(parameter, str):
parameter = parameter.replace("\n\n", "\n")
parameter = parameter.split(",")
prompt = []
info = []
continue_flag = True
for p in parameter:
if p.count(":") > 0 and p.count("\n") > 0:
continue_flag = False
if continue_flag:
prompt.append(p)
else:
info.append(p.replace("\n", ""))
prompt = ",".join(prompt)
info = "\n".join(info)
parameter = f"{prompt}\n{info}"
except Exception as e:
logger.debug(f"Error {e}")
return []
Expand Down

0 comments on commit 668cc58

Please sign in to comment.