From 6c6f43091b908b9dd1b0098fa7714b8c202c5f48 Mon Sep 17 00:00:00 2001 From: yumoqing Date: Wed, 17 Apr 2024 18:42:45 +0800 Subject: [PATCH] bugfix --- ahserver/llm_client.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/ahserver/llm_client.py b/ahserver/llm_client.py index 4b4f120..7ea5e06 100644 --- a/ahserver/llm_client.py +++ b/ahserver/llm_client.py @@ -37,18 +37,18 @@ class LlmProxy: print('write_chunk(),l=', ll) l = self.line_chunk_match(ll) d = DictObject(** json.loads(l)) + j = {} + for r in self.api.resp or []: + j[r.name] = d.get_data_by_keys(r.value); + if self.api.chunk_filter: v = d.get_data_by_keys(self.api.chunk_filter.name) v1 = self.api.chunk_filter.value op = self.api.chunk_filter.op f = opfuncs.get(op) if f and f(v,v1): - print('filtered', v, op, v1, f) - return - - j = {} - for r in self.api.resp or []: - j[r.name] = d.get_data_by_keys(r.value); + j[self.api.chunk_filter.field] = '' + print('filtered j=', j) jstr = json.dumps(j) + '\n' bin = jstr.encode('utf-8')