python: Only eval latest message in chat sessions (#1149)

* python: Only eval latest message in chat sessions

* python: version bump
pull/1157/head
Aaron Miller 12 months ago committed by GitHub
parent ee73f1ab1d
commit ed470e18b3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -220,7 +220,7 @@ class GPT4All:
if self._is_chat_session_activated:
self.current_chat_session.append({"role": "user", "content": prompt})
generate_kwargs['prompt'] = self._format_chat_prompt_template(messages=self.current_chat_session)
generate_kwargs['prompt'] = self._format_chat_prompt_template(messages=self.current_chat_session[-1:])
generate_kwargs['reset_context'] = len(self.current_chat_session) == 1
else:
generate_kwargs['reset_context'] = True

@ -61,7 +61,7 @@ copy_prebuilt_C_lib(SRC_CLIB_DIRECtORY,
setup(
name=package_name,
version="1.0.2",
version="1.0.3",
description="Python bindings for GPT4All",
author="Richard Guo",
author_email="richard@nomic.ai",

Loading…
Cancel
Save