Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Require tool_calls or content to be set for assistant role #976

Merged
merged 4 commits into from
Feb 9, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion memgpt/data_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ def to_openai_dict(self):
openai_message["name"] = self.name

elif self.role == "assistant":
assert all([v is not None for v in [self.text, self.role]]), vars(self)
assert self.tool_calls is not None or self.text is not None
cpacker marked this conversation as resolved.
Show resolved Hide resolved
openai_message = {
"content": self.text,
"role": self.role,
Expand Down
Loading