File tree Expand file tree Collapse file tree 4 files changed +58
-6
lines changed
routes/chat/[agentId]/[conversationId]/stateLogs Expand file tree Collapse file tree 4 files changed +58
-6
lines changed Original file line number Diff line number Diff line change @@ -95,5 +95,12 @@ export function replaceNewLine(text) {
9595 * @returns string
9696 */
9797export function replaceMarkdown ( text ) {
98- return text . replace ( / # ( [ \s ] * ) / g, '\\# ' ) . replace ( / \* ( [ \s ] * ) / g, '\\* ' ) ;
98+ let res = text . replace ( / # ( [ \s ] + ) / g, '\\# ' ) ;
99+
100+ let regex = new RegExp ( '\\*(.*?)\\*' , 'g' ) ;
101+ if ( ! regex . test ( text ) ) {
102+ res = res . replace ( / \* ( [ \s ] * ) / g, '\\* ' ) ;
103+ }
104+
105+ return res ;
99106}
Original file line number Diff line number Diff line change @@ -303,7 +303,9 @@ IRichContent.prototype.text;
303303 * @property {string } conversation_id - The conversation id.
304304 * @property {string } message_id - The message id.
305305 * @property {string } before_value - The value before change.
306+ * @property {number? } before_active_rounds - The state active rounds before change.
306307 * @property {string } after_value - The value after change.
308+ * @property {number? } after_active_rounds - The state active rounds after change.
307309 * @property {Date } created_at - The log sent time.
308310 */
309311
Original file line number Diff line number Diff line change 435435
436436 .state-change-container {
437437 margin-top : 0px ;
438- margin-bottom : 0 px ;
438+ margin-bottom : 5 px ;
439439
440440 .state-key {
441441 color : var (--bs-primary );
448448 .state-value {
449449 min-width : 50% ;
450450 font-size : 15px ;
451- margin-top : 3px ;
452- margin-bottom : 3px ;
451+
452+ .active-rounds {
453+ font-size : 12px ;
454+ }
453455 }
454456 }
455457 }
Original file line number Diff line number Diff line change 22
33 /** @type {any} */
44 export let data;
5+
6+ /** @type {string} */
7+ let beforeActiveRoundText = ' ' ;
8+ let afterActiveRoundText = ' ' ;
9+
10+ $: {
11+ beforeActiveRoundText = buildActiveRoundText (data? .before_value , data? .before_active_rounds );
12+ afterActiveRoundText = buildActiveRoundText (data? .after_value , data? .after_active_rounds );
13+ }
14+
15+ /**
16+ * @param {any} value
17+ * @param {any} activeRounds
18+ */
19+ function buildActiveRoundText (value , activeRounds ) {
20+ let text = ' ' ;
21+
22+ if (!!! value) {
23+ return text;
24+ }
25+
26+ if (activeRounds > 1 ) {
27+ text = ` (active rounds: ${ activeRounds} )` ;
28+ } else if (activeRounds == 1 ) {
29+ text = ` (active round: ${ activeRounds} )` ;
30+ } else {
31+ text = ` (active rounds: infinity)` ;
32+ }
33+
34+ return text;
35+ }
536< / script>
637
738< div class = " log-element state-change-container" >
1041 </div>
1142 <div class="log-content state-value-container">
1243 <div class="state-value">
13- <div >{` ${data ?.before_value || ' unknown' } ` }</div >
44+ <div class="value">
45+ {` ${data? .before_value || ' unknown' }` }
46+ </div>
47+ <div class="active-rounds">
48+ {` ${beforeActiveRoundText}` }
49+ </div>
1450 </div>
1551 <div class="state-value text-warning">
16- <div >{` ${data ?.after_value || ' unknown' } ` }</div >
52+ <div class="value">
53+ {` ${data? .after_value || ' unknown' }` }
54+ </div>
55+ <div class="active-rounds">
56+ {` ${afterActiveRoundText}` }
57+ </div>
1758 </div>
1859 </div>
1960</div>
You can’t perform that action at this time.
0 commit comments