Skip to content

Commit

Permalink
fix completion change (#96)
Browse files Browse the repository at this point in the history
* fix completion change

* tests
  • Loading branch information
hbertrand authored May 10, 2023
1 parent e5f6c22 commit b31fac3
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion buster/busterbot.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ def from_dict(cls, answer_dict: dict):
if isinstance(answer_dict["matched_documents"], str):
answer_dict["matched_documents"] = pd.read_json(answer_dict["matched_documents"], orient="index")
elif isinstance(answer_dict["matched_documents"], dict):
answer_dict["matched_documents"] = pd.DataFrame(answer_dict["matched_documents"])
answer_dict["matched_documents"] = pd.DataFrame(answer_dict["matched_documents"]).T
else:
raise ValueError(f"Unknown type for matched_documents: {type(answer_dict['matched_documents'])}")
answer_dict["completion"] = Completion.from_dict(answer_dict["completion"])
Expand Down
2 changes: 1 addition & 1 deletion buster/completers/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ def generate_response(self, system_prompt, user_input):

completor = self.complete(prompt=prompt, **self.completion_kwargs)

self.completion = Completion(completor, self.error)
self.completion = Completion(completor=completor, error=self.error)

return self.completion

Expand Down
2 changes: 1 addition & 1 deletion tests/test_chatbot.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def complete(self):
return

def generate_response(self, user_input, system_prompt) -> Completion:
return Completion(self.expected_answer, error=False)
return Completion(completor=self.expected_answer, error=False)


class MockRetriever(Retriever):
Expand Down

0 comments on commit b31fac3

Please sign in to comment.