참고소스 수정본
This commit is contained in:
27
참고/neo4j-graphrag-python-main/tests/unit/llm/conftest.py
Normal file
27
참고/neo4j-graphrag-python-main/tests/unit/llm/conftest.py
Normal file
@@ -0,0 +1,27 @@
|
||||
import pytest
|
||||
|
||||
from neo4j_graphrag.tool import Tool, ObjectParameter, StringParameter
|
||||
|
||||
|
||||
class TestTool(Tool):
|
||||
"""Test tool for unit tests."""
|
||||
|
||||
def __init__(self, name: str = "test_tool", description: str = "A test tool"):
|
||||
parameters = ObjectParameter(
|
||||
description="Test parameters",
|
||||
properties={"param1": StringParameter(description="Test parameter")},
|
||||
required_properties=["param1"],
|
||||
additional_properties=False,
|
||||
)
|
||||
|
||||
super().__init__(
|
||||
name=name,
|
||||
description=description,
|
||||
parameters=parameters,
|
||||
execute_func=lambda **kwargs: kwargs,
|
||||
)
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def test_tool() -> Tool:
|
||||
return TestTool()
|
||||
Reference in New Issue
Block a user