spawnllm 0.1.0__tar.gz → 0.1.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {spawnllm-0.1.0 → spawnllm-0.1.2}/PKG-INFO +1 -1
- {spawnllm-0.1.0 → spawnllm-0.1.2}/pyproject.toml +1 -1
- {spawnllm-0.1.0 → spawnllm-0.1.2}/spawnllm/backends/claude.py +3 -1
- {spawnllm-0.1.0 → spawnllm-0.1.2}/spawnllm/structured.py +7 -3
- {spawnllm-0.1.0 → spawnllm-0.1.2}/LICENSE +0 -0
- {spawnllm-0.1.0 → spawnllm-0.1.2}/README.md +0 -0
- {spawnllm-0.1.0 → spawnllm-0.1.2}/spawnllm/__init__.py +0 -0
- {spawnllm-0.1.0 → spawnllm-0.1.2}/spawnllm/__main__.py +0 -0
- {spawnllm-0.1.0 → spawnllm-0.1.2}/spawnllm/backends/__init__.py +0 -0
- {spawnllm-0.1.0 → spawnllm-0.1.2}/spawnllm/backends/base.py +0 -0
- {spawnllm-0.1.0 → spawnllm-0.1.2}/spawnllm/backends/codex.py +0 -0
- {spawnllm-0.1.0 → spawnllm-0.1.2}/spawnllm/backends/registry.py +0 -0
- {spawnllm-0.1.0 → spawnllm-0.1.2}/spawnllm/call.py +0 -0
- {spawnllm-0.1.0 → spawnllm-0.1.2}/spawnllm/cli.py +0 -0
- {spawnllm-0.1.0 → spawnllm-0.1.2}/spawnllm/mlx/__init__.py +0 -0
- {spawnllm-0.1.0 → spawnllm-0.1.2}/spawnllm/mlx/codec.py +0 -0
- {spawnllm-0.1.0 → spawnllm-0.1.2}/spawnllm/mlx/engine.py +0 -0
- {spawnllm-0.1.0 → spawnllm-0.1.2}/spawnllm/mlx/fuse.py +0 -0
- {spawnllm-0.1.0 → spawnllm-0.1.2}/spawnllm/mlx/patches.py +0 -0
- {spawnllm-0.1.0 → spawnllm-0.1.2}/spawnllm/proc.py +0 -0
- {spawnllm-0.1.0 → spawnllm-0.1.2}/spawnllm/py.typed +0 -0
- {spawnllm-0.1.0 → spawnllm-0.1.2}/spawnllm/types.py +0 -0
|
@@ -94,7 +94,9 @@ class ClaudeCliBackend(LlmBackend):
|
|
|
94
94
|
return parse_structured_output(raw, response_model)
|
|
95
95
|
|
|
96
96
|
def env(self) -> dict[str, str]:
|
|
97
|
-
|
|
97
|
+
# CLAUDE_CODE_SIMPLE=1 breaks claude.ai keychain auth ("Not logged in")
|
|
98
|
+
# on current CLIs; --setting-sources ""/--strict-mcp-config already trim startup.
|
|
99
|
+
return {}
|
|
98
100
|
|
|
99
101
|
def build_argv(self, content: str, *, model: str) -> list[str]:
|
|
100
102
|
"""Build the inline ``-p`` argv for the sentiment/pushback scoring path."""
|
|
@@ -6,7 +6,7 @@ import json
|
|
|
6
6
|
import os
|
|
7
7
|
import subprocess
|
|
8
8
|
import tempfile
|
|
9
|
-
from typing import TYPE_CHECKING, Any, cast
|
|
9
|
+
from typing import TYPE_CHECKING, Any, cast, overload
|
|
10
10
|
|
|
11
11
|
from spawnllm.backends.codex import CodexCliBackend
|
|
12
12
|
|
|
@@ -39,7 +39,7 @@ def resolve_schema_path(backend: LlmBackend, schema: str | None) -> str | None:
|
|
|
39
39
|
return schema
|
|
40
40
|
|
|
41
41
|
|
|
42
|
-
def extract_structured(events: list[dict[str, Any]], model: type[
|
|
42
|
+
def extract_structured[M: BaseModel](events: list[dict[str, Any]], model: type[M]) -> M | None:
|
|
43
43
|
"""Return the validated ``structured_output`` from a stream-json event list, if present."""
|
|
44
44
|
for e in events:
|
|
45
45
|
if e.get("type") == "result" and "structured_output" in e:
|
|
@@ -47,7 +47,11 @@ def extract_structured(events: list[dict[str, Any]], model: type[BaseModel]) ->
|
|
|
47
47
|
return None
|
|
48
48
|
|
|
49
49
|
|
|
50
|
-
|
|
50
|
+
@overload
|
|
51
|
+
def parse_structured_output(raw: str, response_model: None) -> str: ...
|
|
52
|
+
@overload
|
|
53
|
+
def parse_structured_output[M: BaseModel](raw: str, response_model: type[M]) -> M: ...
|
|
54
|
+
def parse_structured_output[M: BaseModel](raw: str, response_model: type[M] | None) -> str | M:
|
|
51
55
|
if not response_model:
|
|
52
56
|
return raw
|
|
53
57
|
data = json.loads(raw)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|