Skip to content

Conversation

Tushar-ml
Copy link
Contributor

@Tushar-ml Tushar-ml commented Dec 22, 2024

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

  • Format your code according to the Contributor Guide.
  • Add unit tests as outlined in the Contributor Guide.
  • Update documentation as needed, including docstrings or example tutorials.

@HaoyuWang4188
Copy link
Contributor

Based on the communication in Slack, I have left some of my review comments. 😄
Would @Ying1123 please assign an official reviewer? Thank you!

Tushar-ml and others added 3 commits December 25, 2024 22:24
Co-authored-by: Haoyu Wang <120358163+HaoyuWang4188@users.noreply.github.com>
Co-authored-by: Haoyu Wang <120358163+HaoyuWang4188@users.noreply.github.com>
Copy link
Contributor

@merrymercy merrymercy left a 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.

@Tushar-ml
Copy link
Contributor Author

@merrymercy @Ying1123 The above comments have been resolved

Copy link
Contributor

@merrymercy merrymercy left a 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.

@Tushar-ml
Copy link
Contributor Author

Done @merrymercy

@Tushar-ml Tushar-ml changed the title [Feature] Function Tooling [Feature] Function Caling Dec 29, 2024
@Tushar-ml Tushar-ml changed the title [Feature] Function Caling [Feature] Function Calling Dec 29, 2024
@merrymercy merrymercy merged commit 8ee9a85 into sgl-project:main Dec 29, 2024
15 checks passed
Aaron1011 added a commit to tensorzero/tensorzero that referenced this pull request Jan 15, 2025
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.
Aaron1011 added a commit to tensorzero/tensorzero that referenced this pull request Jan 15, 2025
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.
Aaron1011 added a commit to tensorzero/tensorzero that referenced this pull request Jan 15, 2025
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.
Aaron1011 added a commit to tensorzero/tensorzero that referenced this pull request Jan 15, 2025
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.
Aaron1011 added a commit to tensorzero/tensorzero that referenced this pull request Jan 15, 2025
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.
Aaron1011 added a commit to tensorzero/tensorzero that referenced this pull request Jan 16, 2025
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.
Aaron1011 added a commit to tensorzero/tensorzero that referenced this pull request Jan 16, 2025
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.
Aaron1011 added a commit to tensorzero/tensorzero that referenced this pull request Jan 16, 2025
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.
Aaron1011 added a commit to tensorzero/tensorzero that referenced this pull request Jan 16, 2025
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.
github-merge-queue bot pushed a commit to tensorzero/tensorzero that referenced this pull request Jan 16, 2025
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>
github-merge-queue bot pushed a commit to tensorzero/tensorzero that referenced this pull request Jan 16, 2025
* 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>
github-merge-queue bot pushed a commit to tensorzero/tensorzero that referenced this pull request Jan 16, 2025
* 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>
github-merge-queue bot pushed a commit to tensorzero/tensorzero that referenced this pull request Jan 16, 2025
* 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>
github-merge-queue bot pushed a commit to tensorzero/tensorzero that referenced this pull request Jan 16, 2025
* 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>
github-merge-queue bot pushed a commit to tensorzero/tensorzero that referenced this pull request Jan 16, 2025
* 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>
timethink pushed a commit to timethink/sglang that referenced this pull request Mar 9, 2025
Co-authored-by: Haoyu Wang <120358163+HaoyuWang4188@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants