From 8a32cdf4efb7d3cf8ef94c17543f5207eccf0425 Mon Sep 17 00:00:00 2001 From: Devin Gaffney Date: Fri, 3 Nov 2023 13:53:16 -0400 Subject: [PATCH] CV2-2875 tweak response structure --- lib/model/generic_transformer.py | 2 +- lib/schemas.py | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/model/generic_transformer.py b/lib/model/generic_transformer.py index 56ded7c..02d0b73 100644 --- a/lib/model/generic_transformer.py +++ b/lib/model/generic_transformer.py @@ -25,7 +25,7 @@ def respond(self, docs: Union[List[schemas.Message], schemas.Message]) -> List[s vectorizable_texts = [e.body.text for e in docs] vectorized = self.vectorize(vectorizable_texts) for doc, vector in zip(docs, vectorized): - doc.response = vector + doc.hash_value = vector return docs def vectorize(self, texts: List[str]) -> List[List[float]]: diff --git a/lib/schemas.py b/lib/schemas.py index 26bdc03..ccccd8f 100644 --- a/lib/schemas.py +++ b/lib/schemas.py @@ -12,6 +12,7 @@ class TextOutput(BaseModel): id: str callback_url: str text: str + hash_value: HashValue class VideoInput(BaseModel): id: str