-
-
Notifications
You must be signed in to change notification settings - Fork 7k
[Misc] refactor example series - structured outputs #17040
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
[Misc] refactor example series - structured outputs #17040
Conversation
reidliu41
commented
Apr 23, 2025
•
edited by github-actions
bot
Loading
edited by github-actions
bot
- continue to refactor examples
Signed-off-by: reidliu41 <[email protected]>
👋 Hi! Thank you for contributing to the vLLM project. 💬 Join our developer Slack at https://slack.vllm.ai to discuss your PR in #pr-reviews, coordinate on features in #feat- channels, or join special interest groups in #sig- channels. Just a reminder: PRs would not trigger full CI run by default. Instead, it would only run Once the PR is approved and ready to go, your PR reviewer(s) can run CI to test the changes comprehensively before merging. To run CI, PR reviewers can either: Add 🚀 |
Signed-off-by: reidliu41 <[email protected]>
after #16812 |
hi @DarkLight1337 could you pls help to take a look if you have time? thanks |
root ::= select_statement | ||
?table_name: identifier | ||
select_statement ::= "SELECT " column " from " table " where " condition | ||
?column_name: identifier | ||
column ::= "col_1 " | "col_2 " | ||
?identifier: /[a-zA-Z_][a-zA-Z0-9_]*/ | ||
""" | ||
table ::= "table_1 " | "table_2 " | ||
prompt = ("Generate an SQL query to show the 'username' and 'email'" | ||
"from the 'users' table.") | ||
completion = client.chat.completions.create( | ||
model="Qwen/Qwen2.5-3B-Instruct", | ||
messages=[{ | ||
"role": "user", | ||
"content": prompt, | ||
}], | ||
extra_body={"guided_grammar": simplified_sql_grammar}, | ||
) | ||
print(completion.choices[0].message.content) | ||
condition ::= column "= " number | ||
# Extra backend options | ||
prompt = ("Generate an email address for Alan Turing, who works in Enigma." | ||
"End in .com and new line. Example result:" | ||
"[email protected]\n") | ||
number ::= "1 " | "2 " |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems that the content here changed, is that intended?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do you mean the the content of simplified_sql_grammar?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it updated in #16812
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok let's merge the other PR first then
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
actually, 16812 is ready, free feel to help merge. thanks