mirror of
https://github.com/ollama/ollama-python.git
synced 2026-05-02 20:29:27 +08:00
Remove unused func _as_path
This commit is contained in:
parent
fe91357d4b
commit
1050f89831
@ -1160,16 +1160,6 @@ def _copy_tools(tools: Optional[Sequence[Union[Mapping[str, Any], Tool, Callable
|
|||||||
yield convert_function_to_tool(unprocessed_tool) if callable(unprocessed_tool) else Tool.model_validate(unprocessed_tool)
|
yield convert_function_to_tool(unprocessed_tool) if callable(unprocessed_tool) else Tool.model_validate(unprocessed_tool)
|
||||||
|
|
||||||
|
|
||||||
def _as_path(s: Optional[Union[str, PathLike]]) -> Union[Path, None]:
|
|
||||||
if isinstance(s, (str, Path)):
|
|
||||||
try:
|
|
||||||
if (p := Path(s)).exists():
|
|
||||||
return p
|
|
||||||
except Exception:
|
|
||||||
...
|
|
||||||
return None
|
|
||||||
|
|
||||||
|
|
||||||
def _parse_host(host: Optional[str]) -> str:
|
def _parse_host(host: Optional[str]) -> str:
|
||||||
"""
|
"""
|
||||||
>>> _parse_host(None)
|
>>> _parse_host(None)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user