Gpt-oss chat template modifications to support built-in tools, added license, switch to default low reasoning#3945
Gpt-oss chat template modifications to support built-in tools, added license, switch to default low reasoning#3945dkalinowski wants to merge 3 commits intomainfrom
Conversation
There was a problem hiding this comment.
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 %} |
There was a problem hiding this comment.
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 %} |
There was a problem hiding this comment.
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.