feat: browser access (allowed_origins, CORS with Private Network Access), job cancel, Tomie/Unity adapters, benchmark
Includes earlier uncommitted work: Tomie and Unity adapters, benchmark, structured output, call metrics. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
13492929c6
commit
f49ee90477
32 files changed
+2799
-51
No files matched your search
@@ -0,0 +1,17 @@
|
||||
"""Naninovel managed-text dictionary helpers."""
|
||||
|
||||
|
||||
def parse_dictionary(text):
|
||||
result, seen = [], set()
|
||||
for line_number, line in enumerate(text.splitlines(), 1):
|
||||
if not line.strip() or line.lstrip().startswith((";", "#", "//")):
|
||||
continue
|
||||
key, separator, value = line.partition(":")
|
||||
if not separator or not key.strip() or not value.strip():
|
||||
continue
|
||||
key = key.strip()
|
||||
if key in seen:
|
||||
raise ValueError(f"Duplicate dictionary key at line {line_number}: {key}")
|
||||
seen.add(key)
|
||||
result.append({"id": key, "text": value.lstrip(), "line": line_number})
|
||||
return result
|
||||
Reference in new issue
Block a user