Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a6d471fc9b |
+9
-1
@@ -1,5 +1,7 @@
|
|||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
|
from typing import Any
|
||||||
|
|
||||||
from comfy_api.latest import io, ui
|
from comfy_api.latest import io, ui
|
||||||
|
|
||||||
from .client import (
|
from .client import (
|
||||||
@@ -115,7 +117,13 @@ class LMStudioConnect(io.ComfyNode):
|
|||||||
)
|
)
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def validate_inputs(cls, server_url: str, timeout_seconds: int, max_tokens: int) -> bool | str:
|
def validate_inputs(
|
||||||
|
cls,
|
||||||
|
server_url: str,
|
||||||
|
timeout_seconds: int,
|
||||||
|
max_tokens: int,
|
||||||
|
**_: Any,
|
||||||
|
) -> bool | str:
|
||||||
try:
|
try:
|
||||||
normalize_server_url(server_url)
|
normalize_server_url(server_url)
|
||||||
except ValueError as exc:
|
except ValueError as exc:
|
||||||
|
|||||||
@@ -49,6 +49,27 @@ def test_validate_inputs() -> None:
|
|||||||
assert cls.validate_inputs("http://127.0.0.1:1234", 10, 0) == "max_tokens must be >= 1"
|
assert cls.validate_inputs("http://127.0.0.1:1234", 10, 0) == "max_tokens must be >= 1"
|
||||||
|
|
||||||
|
|
||||||
|
def test_validate_inputs_accepts_extra_kwargs() -> None:
|
||||||
|
connect_node = _connect_module()
|
||||||
|
cls = connect_node.LMStudioConnect
|
||||||
|
|
||||||
|
# ComfyUI may pass any of the schema inputs by name; the method must tolerate them.
|
||||||
|
assert (
|
||||||
|
cls.validate_inputs(
|
||||||
|
"http://127.0.0.1:1234",
|
||||||
|
10,
|
||||||
|
128,
|
||||||
|
api_token="-",
|
||||||
|
model="placeholder",
|
||||||
|
reasoning_enabled=False,
|
||||||
|
use_tooling_mcp=False,
|
||||||
|
temperature=0.7,
|
||||||
|
test_connectivity=True,
|
||||||
|
)
|
||||||
|
is True
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
def test_execute_with_placeholder_model_uses_discovered_default(
|
def test_execute_with_placeholder_model_uses_discovered_default(
|
||||||
monkeypatch: pytest.MonkeyPatch,
|
monkeypatch: pytest.MonkeyPatch,
|
||||||
) -> None:
|
) -> None:
|
||||||
|
|||||||
Reference in New Issue
Block a user