Skip to content

Commit b49cd81

Browse files
add headings
1 parent e28836b commit b49cd81

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

docs/models/openai.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,8 @@ A tool that queries an SQL database can only accept valid SQL. The freeform func
178178

179179
A context‑free grammar is a collection of production rules that define which strings belong to a language. Each rule rewrites a non‑terminal symbol into a sequence of terminals (literal tokens) and/or other non‑terminals, independent of surrounding context—hence context‑free. CFGs can capture the syntax of most programming languages and, in OpenAI custom tools, serve as contracts that force the model to emit only strings that the grammar accepts.
180180

181+
##### Regular Expression
182+
181183
The grammar can be written as either a regular expression:
182184

183185

@@ -198,6 +200,8 @@ def timestamp_accepting_tool(timestamp: str): ...
198200
1. The GPT-5 family (`gpt-5`, `gpt-5-mini`, `gpt-5-nano`) all support freeform function calling with context free grammar constraints. Unfortunately gpt-5-nano often struggles with these calls.
199201
2. If the tool or model cannot be used with freeform function calling then it will be invoked in the normal way, which may lead to invalid input.
200202

203+
##### LARK
204+
201205
Or as a [LARK](https://lark-parser.readthedocs.io/en/latest/how_to_use.html) grammar:
202206

203207
```python

0 commit comments

Comments
 (0)