add input variables to begin component (#3498)

### What problem does this PR solve?

#3355 

### Type of change

- [x] New Feature (non-breaking change which adds functionality)
This commit is contained in:
Kevin Hu
2024-11-19 18:41:48 +08:00
committed by GitHub
parent 0cd5b64c3b
commit 361cff34fc
7 changed files with 128 additions and 78 deletions

View File

@ -98,7 +98,8 @@ def message_fit_in(msg, max_length=4000):
return c, msg
msg_ = [m for m in msg[:-1] if m["role"] == "system"]
msg_.append(msg[-1])
if len(msg) > 1:
msg_.append(msg[-1])
msg = msg_
c = count()
if c < max_length: