mirror of
https://github.com/meta-llama/llama-stack.git
synced 2025-12-13 14:52:40 +00:00
Fix and add a test
This commit is contained in:
parent
40ba22f4c8
commit
cd84dee3e9
5 changed files with 76 additions and 62 deletions
|
|
@ -75,17 +75,19 @@ class ChatCompletionResponseEvent(BaseModel):
|
|||
|
||||
|
||||
class ResponseFormatType(Enum):
|
||||
json = "json"
|
||||
json_schema = "json_schema"
|
||||
grammar = "grammar"
|
||||
|
||||
|
||||
class JsonResponseFormat(BaseModel):
|
||||
type: Literal[ResponseFormat.json.value] = ResponseFormat.json.value
|
||||
type: Literal[ResponseFormatType.json_schema.value] = (
|
||||
ResponseFormatType.json_schema.value
|
||||
)
|
||||
schema: Dict[str, Any]
|
||||
|
||||
|
||||
class GrammarResponseFormat(BaseModel):
|
||||
type: Literal[ResponseFormat.grammar.value] = ResponseFormat.grammar.value
|
||||
type: Literal[ResponseFormatType.grammar.value] = ResponseFormatType.grammar.value
|
||||
bnf: Dict[str, Any]
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue