mirror of
https://github.com/ollama/ollama-python.git
synced 2026-05-03 12:52:35 +00:00
types: allow items and defs for tools (#501)
test / test (3.10) (push) Has been cancelled
test / test (3.11) (push) Has been cancelled
test / test (3.12) (push) Has been cancelled
test / test (3.13) (push) Has been cancelled
test / test (3.8) (push) Has been cancelled
test / test (3.9) (push) Has been cancelled
test / lint (push) Has been cancelled
test / test (3.10) (push) Has been cancelled
test / test (3.11) (push) Has been cancelled
test / test (3.12) (push) Has been cancelled
test / test (3.13) (push) Has been cancelled
test / test (3.8) (push) Has been cancelled
test / test (3.9) (push) Has been cancelled
test / lint (push) Has been cancelled
This commit is contained in:
+5
-3
@@ -187,7 +187,7 @@ def test_function_with_only_description():
|
||||
|
||||
tool = convert_function_to_tool(only_description).model_dump()
|
||||
assert tool['function']['description'] == 'A function with only a description.'
|
||||
assert tool['function']['parameters'] == {'type': 'object', 'properties': {}, 'required': None}
|
||||
assert tool['function']['parameters'] == {'type': 'object', 'defs': None, 'items': None, 'required': None, 'properties': {}}
|
||||
|
||||
def only_description_with_args(x: int, y: int):
|
||||
"""
|
||||
@@ -199,9 +199,11 @@ def test_function_with_only_description():
|
||||
assert tool['function']['description'] == 'A function with only a description.'
|
||||
assert tool['function']['parameters'] == {
|
||||
'type': 'object',
|
||||
'defs': None,
|
||||
'items': None,
|
||||
'properties': {
|
||||
'x': {'type': 'integer', 'description': '', 'enum': None},
|
||||
'y': {'type': 'integer', 'description': '', 'enum': None},
|
||||
'x': {'type': 'integer', 'description': '', 'enum': None, 'items': None},
|
||||
'y': {'type': 'integer', 'description': '', 'enum': None, 'items': None},
|
||||
},
|
||||
'required': ['x', 'y'],
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user