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')