Skip to content
Open
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
7 changes: 6 additions & 1 deletion libs/oci/langchain_oci/chat_models/oci_generative_ai.py
Original file line number Diff line number Diff line change
Expand Up @@ -815,7 +815,12 @@ def messages_to_oci_params(
message.tool_calls or message.additional_kwargs.get("tool_calls")
):
# Process content and tool calls for assistant messages
content = self._process_message_content(message.content)
if message.content:
content = self._process_message_content(message.content)
# Issue 78 fix: Check if original content is empty BEFORE processing
# to prevent NullPointerException in OCI backend
else:
content = [self.oci_chat_message_text_content(text=".")]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so there has to be an arbitrary character in the the text?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I tried to use an empty space as the content, but empty space does not work.

tool_calls = []
for tool_call in message.tool_calls:
tool_calls.append(
Expand Down