-
Notifications
You must be signed in to change notification settings - Fork 2.8k
[Feature] Function Calling #2544
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
Conversation
Based on the communication in Slack, I have left some of my review comments. 😄 |
Co-authored-by: Haoyu Wang <120358163+HaoyuWang4188@users.noreply.github.com>
Co-authored-by: Haoyu Wang <120358163+HaoyuWang4188@users.noreply.github.com>
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.
This looks good! I left a few comments.
@merrymercy @Ying1123 The above comments have been resolved |
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.
Some final minor comments! Then we can merge this.
Done @merrymercy |
This is heavily based on the existing OpenAI provider. Current limitations: * SGLang only support JSON output when a json schema is provided, so both 'json_mode = on' and 'json_mode = strict' require a schema to be provided * Tool use was just implemneted in sgl-project/sglang#2544, which is not yet released. For now, we pass through tool parameters using the standard OpenAI API, but log a warning. * Only chat completions (with/without streaming) are currently implemented.
This is heavily based on the existing OpenAI provider. Current limitations: * SGLang only support JSON output when a json schema is provided, so both 'json_mode = on' and 'json_mode = strict' require a schema to be provided * Tool use was just implemneted in sgl-project/sglang#2544, which is not yet released. For now, we pass through tool parameters using the standard OpenAI API, but log a warning. * Only chat completions (with/without streaming) are currently implemented.
This is heavily based on the existing OpenAI provider. Current limitations: * SGLang only support JSON output when a json schema is provided, so both 'json_mode = on' and 'json_mode = strict' require a schema to be provided * Tool use was just implemneted in sgl-project/sglang#2544, which is not yet released. For now, we pass through tool parameters using the standard OpenAI API, but log a warning. * Only chat completions (with/without streaming) are currently implemented.
This is heavily based on the existing OpenAI provider. Current limitations: * SGLang only support JSON output when a json schema is provided, so both 'json_mode = on' and 'json_mode = strict' require a schema to be provided * Tool use was just implemneted in sgl-project/sglang#2544, which is not yet released. For now, we pass through tool parameters using the standard OpenAI API, but log a warning. * Only chat completions (with/without streaming) are currently implemented.
This is heavily based on the existing OpenAI provider. Current limitations: * SGLang only support JSON output when a json schema is provided, so both 'json_mode = on' and 'json_mode = strict' require a schema to be provided * Tool use was just implemneted in sgl-project/sglang#2544, which is not yet released. For now, we pass through tool parameters using the standard OpenAI API, but log a warning. * Only chat completions (with/without streaming) are currently implemented.
This is heavily based on the existing OpenAI provider. Current limitations: * SGLang only support JSON output when a json schema is provided, so both 'json_mode = on' and 'json_mode = strict' require a schema to be provided * Tool use was just implemneted in sgl-project/sglang#2544, which is not yet released. For now, we pass through tool parameters using the standard OpenAI API, but log a warning. * Only chat completions (with/without streaming) are currently implemented.
This is heavily based on the existing OpenAI provider. Current limitations: * SGLang only support JSON output when a json schema is provided, so both 'json_mode = on' and 'json_mode = strict' require a schema to be provided * Tool use was just implemneted in sgl-project/sglang#2544, which is not yet released. For now, we pass through tool parameters using the standard OpenAI API, but log a warning. * Only chat completions (with/without streaming) are currently implemented.
This is heavily based on the existing OpenAI provider. Current limitations: * SGLang only support JSON output when a json schema is provided, so both 'json_mode = on' and 'json_mode = strict' require a schema to be provided * Tool use was just implemneted in sgl-project/sglang#2544, which is not yet released. For now, we pass through tool parameters using the standard OpenAI API, but log a warning. * Only chat completions (with/without streaming) are currently implemented.
This is heavily based on the existing OpenAI provider. Current limitations: * SGLang only support JSON output when a json schema is provided, so both 'json_mode = on' and 'json_mode = strict' require a schema to be provided * Tool use was just implemneted in sgl-project/sglang#2544, which is not yet released. For now, we pass through tool parameters using the standard OpenAI API, but log a warning. * Only chat completions (with/without streaming) are currently implemented.
This is heavily based on the existing OpenAI provider. Current limitations: * SGLang only support JSON output when a json schema is provided, so both 'json_mode = on' and 'json_mode = strict' require a schema to be provided * Tool use was just implemneted in sgl-project/sglang#2544, which is not yet released. For now, we pass through tool parameters using the standard OpenAI API, but log a warning. * Only chat completions (with/without streaming) are currently implemented. Co-authored-by: Aaron Hill <aaron@tensorzero.com> Co-authored-by: Viraj Mehta <virajmehta@users.noreply.github.com>
* Add SGLang provider This is heavily based on the existing OpenAI provider. Current limitations: * SGLang only support JSON output when a json schema is provided, so both 'json_mode = on' and 'json_mode = strict' require a schema to be provided * Tool use was just implemneted in sgl-project/sglang#2544, which is not yet released. For now, we pass through tool parameters using the standard OpenAI API, but log a warning. * Only chat completions (with/without streaming) are currently implemented. * Use SGLANG_API_KEY in merge-queue.yml --------- Co-authored-by: Aaron Hill <aaron@tensorzero.com> Co-authored-by: Viraj Mehta <virajmehta@users.noreply.github.com>
* Add SGLang provider This is heavily based on the existing OpenAI provider. Current limitations: * SGLang only support JSON output when a json schema is provided, so both 'json_mode = on' and 'json_mode = strict' require a schema to be provided * Tool use was just implemneted in sgl-project/sglang#2544, which is not yet released. For now, we pass through tool parameters using the standard OpenAI API, but log a warning. * Only chat completions (with/without streaming) are currently implemented. * Use SGLANG_API_KEY in merge-queue.yml --------- Co-authored-by: Aaron Hill <aaron@tensorzero.com> Co-authored-by: Viraj Mehta <virajmehta@users.noreply.github.com>
* Add SGLang provider This is heavily based on the existing OpenAI provider. Current limitations: * SGLang only support JSON output when a json schema is provided, so both 'json_mode = on' and 'json_mode = strict' require a schema to be provided * Tool use was just implemneted in sgl-project/sglang#2544, which is not yet released. For now, we pass through tool parameters using the standard OpenAI API, but log a warning. * Only chat completions (with/without streaming) are currently implemented. * Use SGLANG_API_KEY in merge-queue.yml --------- Co-authored-by: Aaron Hill <aaron@tensorzero.com> Co-authored-by: Viraj Mehta <virajmehta@users.noreply.github.com>
* Add SGLang provider This is heavily based on the existing OpenAI provider. Current limitations: * SGLang only support JSON output when a json schema is provided, so both 'json_mode = on' and 'json_mode = strict' require a schema to be provided * Tool use was just implemneted in sgl-project/sglang#2544, which is not yet released. For now, we pass through tool parameters using the standard OpenAI API, but log a warning. * Only chat completions (with/without streaming) are currently implemented. * Use SGLANG_API_KEY in merge-queue.yml --------- Co-authored-by: Aaron Hill <aaron@tensorzero.com> Co-authored-by: Viraj Mehta <virajmehta@users.noreply.github.com>
* Add SGLang provider This is heavily based on the existing OpenAI provider. Current limitations: * SGLang only support JSON output when a json schema is provided, so both 'json_mode = on' and 'json_mode = strict' require a schema to be provided * Tool use was just implemneted in sgl-project/sglang#2544, which is not yet released. For now, we pass through tool parameters using the standard OpenAI API, but log a warning. * Only chat completions (with/without streaming) are currently implemented. * Use SGLANG_API_KEY in merge-queue.yml --------- Co-authored-by: Aaron Hill <aaron@tensorzero.com> Co-authored-by: Viraj Mehta <virajmehta@users.noreply.github.com>
Co-authored-by: Haoyu Wang <120358163+HaoyuWang4188@users.noreply.github.com>
Motivation
This PR provides support for function calling #2429 . Currently function tooling implemented for tokenizer apply_chat_template. Streaming not support as well for function tooling.
Modifications
Checklist