@@ -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