mirror of
https://github.com/hwchase17/langchain.git
synced 2025-09-09 23:12:38 +00:00
committed by
GitHub
parent
836c2a4ae0
commit
f4e738bb40
@@ -54,7 +54,6 @@ def annotated_function() -> Callable:
|
||||
arg2: ExtensionsAnnotated[Literal["bar", "baz"], "one of 'bar', 'baz'"],
|
||||
) -> None:
|
||||
"""dummy function"""
|
||||
pass
|
||||
|
||||
return dummy_function
|
||||
|
||||
@@ -68,7 +67,6 @@ def function() -> Callable:
|
||||
arg1: foo
|
||||
arg2: one of 'bar', 'baz'
|
||||
"""
|
||||
pass
|
||||
|
||||
return dummy_function
|
||||
|
||||
@@ -220,7 +218,6 @@ class Dummy:
|
||||
arg1: foo
|
||||
arg2: one of 'bar', 'baz'
|
||||
"""
|
||||
pass
|
||||
|
||||
|
||||
class DummyWithClassMethod:
|
||||
@@ -232,7 +229,6 @@ class DummyWithClassMethod:
|
||||
arg1: foo
|
||||
arg2: one of 'bar', 'baz'
|
||||
"""
|
||||
pass
|
||||
|
||||
|
||||
def test_convert_to_openai_function(
|
||||
@@ -334,7 +330,6 @@ def test_convert_to_openai_function_nested_v2() -> None:
|
||||
|
||||
def my_function(arg1: NestedV2) -> None:
|
||||
"""dummy function"""
|
||||
pass
|
||||
|
||||
convert_to_openai_function(my_function)
|
||||
|
||||
@@ -348,7 +343,6 @@ def test_convert_to_openai_function_nested() -> None:
|
||||
|
||||
def my_function(arg1: Nested) -> None:
|
||||
"""dummy function"""
|
||||
pass
|
||||
|
||||
expected = {
|
||||
"name": "my_function",
|
||||
@@ -386,7 +380,6 @@ def test_convert_to_openai_function_nested_strict() -> None:
|
||||
|
||||
def my_function(arg1: Nested) -> None:
|
||||
"""dummy function"""
|
||||
pass
|
||||
|
||||
expected = {
|
||||
"name": "my_function",
|
||||
@@ -429,7 +422,6 @@ def test_function_optional_param() -> None:
|
||||
c: Optional[list[Optional[str]]],
|
||||
) -> None:
|
||||
"""A test function"""
|
||||
pass
|
||||
|
||||
func = convert_to_openai_function(func5)
|
||||
req = func["parameters"]["required"]
|
||||
@@ -439,7 +431,6 @@ def test_function_optional_param() -> None:
|
||||
def test_function_no_params() -> None:
|
||||
def nullary_function() -> None:
|
||||
"""nullary function"""
|
||||
pass
|
||||
|
||||
func = convert_to_openai_function(nullary_function)
|
||||
req = func["parameters"].get("required")
|
||||
@@ -781,7 +772,6 @@ def test_convert_union_type_py_39() -> None:
|
||||
@tool
|
||||
def magic_function(input: int | float) -> str:
|
||||
"""Compute a magic function."""
|
||||
pass
|
||||
|
||||
result = convert_to_openai_function(magic_function)
|
||||
assert result["parameters"]["properties"]["input"] == {
|
||||
|
Reference in New Issue
Block a user