Skip to content

Commit ea0e0dc

Browse files
Update ollama/_types.py
Co-authored-by: Parth Sareen <[email protected]>
1 parent 2095fc9 commit ea0e0dc

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

ollama/_types.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,11 @@ def __setitem__(self, key: str, value: Any) -> None:
4040
>>> msg['role'] = 'assistant'
4141
>>> msg['role']
4242
'assistant'
43+
>>> tool_call = Message.ToolCall(function=Message.ToolCall.Function(name='foo', arguments={}))
44+
>>> msg = Message(role='user', content='hello')
45+
>>> msg['tool_calls'] = [tool_call]
46+
>>> msg['tool_calls'][0]['function']['name']
47+
'foo'
4348
"""
4449
setattr(self, key, value)
4550

0 commit comments

Comments
 (0)