Update ollama/_types.py

Co-authored-by: Parth Sareen <parth.sareen@ollama.com>
This commit is contained in:
Jeffrey Morgan 2024-11-26 10:35:57 -08:00 committed by GitHub
parent 2095fc9107
commit ea0e0dc692
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -40,6 +40,11 @@ class SubscriptableBaseModel(BaseModel):
>>> msg['role'] = 'assistant'
>>> msg['role']
'assistant'
>>> tool_call = Message.ToolCall(function=Message.ToolCall.Function(name='foo', arguments={}))
>>> msg = Message(role='user', content='hello')
>>> msg['tool_calls'] = [tool_call]
>>> msg['tool_calls'][0]['function']['name']
'foo'
"""
setattr(self, key, value)