From 5ecdf30fdcf0991fb6b88930a70e22f66dada368 Mon Sep 17 00:00:00 2001 From: Adil Hafeez Date: Tue, 30 Jul 2024 18:20:57 -0700 Subject: [PATCH] refactor callout context arm handler code --- envoyfilter/src/stream_context.rs | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/envoyfilter/src/stream_context.rs b/envoyfilter/src/stream_context.rs index 36d90edf..74503c70 100644 --- a/envoyfilter/src/stream_context.rs +++ b/envoyfilter/src/stream_context.rs @@ -484,19 +484,10 @@ impl Context for StreamContext { }; match callout_context.request_type { - RequestType::GetEmbedding => { - self.embeddings_handler(body, callout_context); - } - - RequestType::SearchPoints => { - self.search_points_handler(body, callout_context); - } - RequestType::Ner => { - self.ner_handler(body, callout_context); - } - RequestType::ContextResolver => { - self.context_resolver_handler(body, callout_context); - } + RequestType::GetEmbedding => self.embeddings_handler(body, callout_context), + RequestType::SearchPoints => self.search_points_handler(body, callout_context), + RequestType::Ner => self.ner_handler(body, callout_context), + RequestType::ContextResolver => self.context_resolver_handler(body, callout_context), } } }