We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c3c2515 commit 83803a7Copy full SHA for 83803a7
api/db/services/dialog_service.py
@@ -58,17 +58,17 @@ def count():
58
if c < max_length:
59
return c, msg
60
61
- ll = num_tokens_from_string(msg_[0].content)
62
- l = num_tokens_from_string(msg_[-1].content)
+ ll = num_tokens_from_string(msg_[0]["content"])
+ l = num_tokens_from_string(msg_[-1]["content"])
63
if ll / (ll + l) > 0.8:
64
- m = msg_[0].content
+ m = msg_[0]["content"]
65
m = encoder.decode(encoder.encode(m)[:max_length - l])
66
- msg[0].content = m
+ msg[0]["content"] = m
67
return max_length, msg
68
69
- m = msg_[1].content
+ m = msg_[1]["content"]
70
71
- msg[1].content = m
+ msg[1]["content"] = m
72
73
74
0 commit comments