Skip to content

Commit 337cb6c

Browse files
committed
minor updates
1 parent 10a1219 commit 337cb6c

File tree

2 files changed

+6
-9
lines changed

2 files changed

+6
-9
lines changed

code-helper/client/src/app.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -235,10 +235,7 @@ class VoiceChatClient {
235235
this.emboldenBotWord(word);
236236
return;
237237
}
238-
console.log('! Word not found for emboldening:', word, yetToEmbolden);
239238
return;
240-
} else {
241-
console.log('! Emboldening word:', word);
242239
}
243240
// Replace the first occurrence of the word with <strong>word</strong>
244241
// Use word boundaries to match the whole word

code-helper/server/bot.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -66,19 +66,19 @@ async def run_bot(transport: BaseTransport, runner_args: RunnerArguments):
6666

6767
# LLM text processor to identify code blocks, credit cards, and urls
6868
llm_text_aggregator = PatternPairAggregator()
69-
llm_text_aggregator.add_pattern_pair(
69+
llm_text_aggregator.add_pattern(
7070
type="code",
7171
start_pattern="<code>",
7272
end_pattern="</code>",
7373
action=MatchAction.AGGREGATE,
7474
)
75-
llm_text_aggregator.add_pattern_pair(
75+
llm_text_aggregator.add_pattern(
7676
type="credit_card",
7777
start_pattern="<card>",
7878
end_pattern="</card>",
7979
action=MatchAction.AGGREGATE,
8080
)
81-
llm_text_aggregator.add_pattern_pair(
81+
llm_text_aggregator.add_pattern(
8282
type="link",
8383
start_pattern="<link>",
8484
end_pattern="</link>",
@@ -107,8 +107,8 @@ async def strip_url_protocol(text: str, type: str) -> str:
107107
text = text[len("www.") :]
108108
return text
109109

110-
tts.transform_aggregation_type("link", strip_url_protocol)
111-
tts.transform_aggregation_type("credit_card", spell_out_text)
110+
tts.add_text_transformer(strip_url_protocol, "link")
111+
tts.add_text_transformer(spell_out_text, "credit_card")
112112

113113
# LLM service
114114
llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY"))
@@ -143,7 +143,7 @@ async def obfuscate_credit_card(text: str, type: str) -> str:
143143

144144
rtviIn = RTVIProcessor()
145145
rtviOut = RTVIObserver(rtviIn)
146-
rtviOut.transform_aggregation_type("credit_card", obfuscate_credit_card)
146+
rtviOut.add_bot_output_transformer(obfuscate_credit_card, "credit_card")
147147

148148
# Pipeline
149149
pipeline = Pipeline(

0 commit comments

Comments
 (0)