-
Notifications
You must be signed in to change notification settings - Fork 238
Gpt-oss chat template modifications to support built-in tools, added license, switch to default low reasoning #3945
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?
Conversation
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.
Pull request overview
This PR modifies the GPT-OSS chat template to properly support built-in tools (python, browser) according to OpenAI Harmony format specifications, and adds an Apache 2.0 license header.
Changes:
- Added Apache 2.0 license header with Intel copyright
- Updated built-in tool rendering to use analysis channel instead of commentary channel
- Fixed message constraint rendering and added support for previous reasoning_content messages
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| {%- set last_tool_call.name = tool_call.name %} | ||
| {%- else %} | ||
| {{- "<|channel|>commentary to=functions." + tool_call.name + " " }} | ||
| {{- (tool_call.content_type if tool_call.content_type is defined else "<|constrain|>json") + "<|message|>" }} | ||
| {%- set last_tool_call.name = tool_call.name %} | ||
| {%- endif %} |
Copilot
AI
Feb 3, 2026
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.
The assignment of last_tool_call.name is duplicated in both branches of the if-else statement. This can be moved outside the conditional block (after line 344) to avoid redundancy.
| {%- set last_tool_call.name = tool_call.name %} | |
| {%- else %} | |
| {{- "<|channel|>commentary to=functions." + tool_call.name + " " }} | |
| {{- (tool_call.content_type if tool_call.content_type is defined else "<|constrain|>json") + "<|message|>" }} | |
| {%- set last_tool_call.name = tool_call.name %} | |
| {%- endif %} | |
| {%- else %} | |
| {{- "<|channel|>commentary to=functions." + tool_call.name + " " }} | |
| {{- (tool_call.content_type if tool_call.content_type is defined else "<|constrain|>json") + "<|message|>" }} | |
| {%- endif %} | |
| {%- set last_tool_call.name = tool_call.name %} |
| {%- set last_tool_call.name = tool_call.name %} | ||
| {%- else %} | ||
| {{- "<|channel|>commentary to=functions." + tool_call.name + " " }} | ||
| {{- (tool_call.content_type if tool_call.content_type is defined else "<|constrain|>json") + "<|message|>" }} | ||
| {%- set last_tool_call.name = tool_call.name %} | ||
| {%- endif %} |
Copilot
AI
Feb 3, 2026
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.
The assignment of last_tool_call.name is duplicated in both branches of the if-else statement. This can be moved outside the conditional block (after line 344) to avoid redundancy.
| {%- set last_tool_call.name = tool_call.name %} | |
| {%- else %} | |
| {{- "<|channel|>commentary to=functions." + tool_call.name + " " }} | |
| {{- (tool_call.content_type if tool_call.content_type is defined else "<|constrain|>json") + "<|message|>" }} | |
| {%- set last_tool_call.name = tool_call.name %} | |
| {%- endif %} | |
| {%- else %} | |
| {{- "<|channel|>commentary to=functions." + tool_call.name + " " }} | |
| {{- (tool_call.content_type if tool_call.content_type is defined else "<|constrain|>json") + "<|message|>" }} | |
| {%- endif %} | |
| {%- set last_tool_call.name = tool_call.name %} |
No description provided.