[Feature] New structural tag support (#10691)
This commit is contained in:
12
python/sglang/srt/constrained/utils.py
Normal file
12
python/sglang/srt/constrained/utils.py
Normal file
@@ -0,0 +1,12 @@
|
||||
from typing import Dict
|
||||
|
||||
|
||||
def is_legacy_structural_tag(obj: Dict) -> bool:
|
||||
# test whether an object is a legacy structural tag
|
||||
# see `StructuralTagResponseFormat` at `sglang.srt.entrypoints.openai.protocol`
|
||||
if obj.get("structures", None) is not None:
|
||||
assert obj.get("triggers", None) is not None
|
||||
return True
|
||||
else:
|
||||
assert obj.get("format", None) is not None
|
||||
return False
|
||||
Reference in New Issue
Block a user