Skip to content

Commit

Permalink
Make methods internal
Browse files Browse the repository at this point in the history
  • Loading branch information
vblagoje committed Dec 20, 2024
1 parent 3bc124d commit 877a3e6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions haystack_experimental/dataclasses/tool.py
Original file line number Diff line number Diff line change
Expand Up @@ -212,9 +212,9 @@ def from_openapi(cls, spec: Union[str, Path], operation_name: str, **kwargs) ->
:returns: Tool instance for the specified operation
:raises ValueError: If the OpenAPI specification is invalid or cannot be loaded
"""
from haystack_experimental.tools.openapi import create_tool_from_openapi_spec
from haystack_experimental.tools.openapi import _create_tool_from_openapi_spec

return create_tool_from_openapi_spec(spec=spec, operation_name=operation_name, **kwargs)
return _create_tool_from_openapi_spec(spec=spec, operation_name=operation_name, **kwargs)


def _remove_title_from_schema(schema: Dict[str, Any]):
Expand Down
6 changes: 3 additions & 3 deletions haystack_experimental/tools/openapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class OpenAPIKwargs(TypedDict, total=False):
allowed_operations: List[str] # A list of operations to include in the OpenAPI client.


def create_tool_from_openapi_spec(spec: Union[str, Path], operation_name: str, **kwargs) -> "Tool":
def _create_tool_from_openapi_spec(spec: Union[str, Path], operation_name: str, **kwargs) -> "Tool":
"""
Create a Tool instance from an OpenAPI specification and a specific operation name.
Expand All @@ -52,7 +52,7 @@ def create_tool_from_openapi_spec(spec: Union[str, Path], operation_name: str, *
# Remove None values from the dictionary
config = {k: v for k, v in config.items() if v is not None}

tools = create_tools_from_openapi_spec(spec=spec, **config)
tools = _create_tools_from_openapi_spec(spec=spec, **config)

# Ensure we have only one tool
if len(tools) != 1:
Expand All @@ -65,7 +65,7 @@ def create_tool_from_openapi_spec(spec: Union[str, Path], operation_name: str, *
return tools[0]


def create_tools_from_openapi_spec(spec: Union[str, Path], **kwargs: OpenAPIKwargs) -> List["Tool"]:
def _create_tools_from_openapi_spec(spec: Union[str, Path], **kwargs: OpenAPIKwargs) -> List["Tool"]:
"""
Create Tool instances from an OpenAPI specification.
Expand Down

0 comments on commit 877a3e6

Please sign in to comment.