mirror of
https://github.com/ollama/ollama-python.git
synced 2026-01-13 21:57:16 +08:00
Update ollama/_types.py
Co-authored-by: Parth Sareen <parth.sareen@ollama.com>
This commit is contained in:
parent
d8d98e17b2
commit
d4c38978d1
@ -93,6 +93,9 @@ class SubscriptableBaseModel(BaseModel):
|
||||
>>> msg = Message(role='user')
|
||||
>>> msg.get('nonexistent', 'default')
|
||||
'default'
|
||||
>>> msg = Message(role='user', tool_calls=[ Message.ToolCall(function=Message.ToolCall.Function(name='foo', arguments={}))])
|
||||
>>> msg.get('tool_calls')[0]['function']['name']
|
||||
'foo'
|
||||
"""
|
||||
return self[key] if key in self else default
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user