Skip to content

feat:Add Qwen3.5-9B model and expand CompletionRequest schema#217

Merged
HavenDV merged 1 commit intomainfrom
bot/update-openapi_202603132136
Mar 13, 2026
Merged

feat:Add Qwen3.5-9B model and expand CompletionRequest schema#217
HavenDV merged 1 commit intomainfrom
bot/update-openapi_202603132136

Conversation

@HavenDV
Copy link
Contributor

@HavenDV HavenDV commented Mar 13, 2026

Summary by CodeRabbit

  • New Features

    • Added Qwen/Qwen3.5-9B model to available chat completion models.
    • Extended completion capabilities with structured outputs, function calling, advanced reasoning controls, and moderation options.
  • Documentation

    • Updated code examples across Python, TypeScript, JavaScript, and Shell to reflect new model and expanded functionality.

@HavenDV HavenDV enabled auto-merge March 13, 2026 21:37
@coderabbitai
Copy link

coderabbitai bot commented Mar 13, 2026

Walkthrough

Extended the OpenAPI specification to introduce support for a new model (Qwen/Qwen3.5-9B) and expanded the CompletionRequest schema with nine new fields enabling structured outputs, tool usage, moderation controls, and configurable reasoning behavior.

Changes

Cohort / File(s) Summary
OpenAPI Schema Extensions
src/libs/Together/openapi.yaml
Added Qwen/Qwen3.5-9B model to ChatCompletionRequest enum; expanded CompletionRequest schema with new fields (response_format, tools, tool_choice, compliance, chat_template_kwargs, safety_model, reasoning_effort, reasoning, context_length_exceeded_behavior); updated code sample payloads across Python, TypeScript, JavaScript, and Shell to reflect new model and reasoning parameters.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

A model named Qwen hops into view,
Nine fields bloom like morning dew,
Reasoning, tools, and moderation's grace—
The schema grows, embracing new space! 🐰✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Title Check ✅ Passed Title check skipped as CodeRabbit has written the PR title.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch bot/update-openapi_202603132136
📝 Coding Plan
  • Generate coding plan for human review comments

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@HavenDV HavenDV merged commit cd53050 into main Mar 13, 2026
3 of 4 checks passed
@HavenDV HavenDV deleted the bot/update-openapi_202603132136 branch March 13, 2026 21:38
@coderabbitai coderabbitai bot changed the title feat:@coderabbitai feat:Add Qwen3.5-9B model and expand CompletionRequest schema Mar 13, 2026
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/libs/Together/openapi.yaml (1)

5940-5950: ⚠️ Potential issue | 🟠 Major

Use request-shaped schemas for tools and tool_choice.

Line 5943 points tools at ToolsPart, which does not require type: function or function.name. Line 5949 points tool_choice at ToolChoice, which requires response-only fields like id, index, and function.arguments. That will generate request models that both accept invalid tool definitions and reject valid tool_choice objects.

🔧 Suggested schema split
         tools:
           type: array
           items:
-            $ref: '#/components/schemas/ToolsPart'
+            $ref: '#/components/schemas/ChatCompletionTool'
           description: 'A list of tools the model may call. Currently, only functions are supported as a tool. Use this to provide a list of functions the model may generate JSON inputs for.'
         tool_choice:
           oneOf:
             - type: string
               example: tool_name
-            - $ref: '#/components/schemas/ToolChoice'
+            - $ref: '#/components/schemas/ToolChoiceRequest'
           description: 'Controls which (if any) function is called by the model. By default uses `auto`, which lets the model pick between generating a message or calling a function.'
components:
  schemas:
    ToolChoiceRequest:
      required:
        - type
        - function
      type: object
      properties:
        type:
          enum:
            - function
          type: string
        function:
          required:
            - name
          type: object
          properties:
            name:
              type: string
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/libs/Together/openapi.yaml` around lines 5940 - 5950, The OpenAPI schemas
for tools and tool_choice must use request-shaped types: add a new components
schema (e.g., ToolChoiceRequest) that requires type with enum ["function"] and a
function object requiring name, update ToolsPart or add a ToolsRequest schema so
each item enforces type:function and function.name, then change the tools array
to reference the request schema (ToolsRequest/ToolsPartRequest) and change
tool_choice's oneOf to reference the string example or the new ToolChoiceRequest
instead of the response-oriented ToolChoice; update any references to ToolsPart
and ToolChoice to their request-shaped counterparts.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@src/libs/Together/openapi.yaml`:
- Around line 964-976: The CompletionRequest.model enum in the OpenAPI spec is
missing the "Qwen/Qwen3.5-9B" entry that your examples use; update the schema so
the CompletionRequest.model enum (and thus the generated CompletionRequestModel)
includes the value "Qwen/Qwen3.5-9B" just like ChatCompletionRequest does, then
regenerate the client code so the generated CompletionRequestModel contains that
value and callers using CompletionRequest.model can reference "Qwen/Qwen3.5-9B".

---

Outside diff comments:
In `@src/libs/Together/openapi.yaml`:
- Around line 5940-5950: The OpenAPI schemas for tools and tool_choice must use
request-shaped types: add a new components schema (e.g., ToolChoiceRequest) that
requires type with enum ["function"] and a function object requiring name,
update ToolsPart or add a ToolsRequest schema so each item enforces
type:function and function.name, then change the tools array to reference the
request schema (ToolsRequest/ToolsPartRequest) and change tool_choice's oneOf to
reference the string example or the new ToolChoiceRequest instead of the
response-oriented ToolChoice; update any references to ToolsPart and ToolChoice
to their request-shaped counterparts.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: e44d84f5-df4d-4609-a4dc-d140a903564f

📥 Commits

Reviewing files that changed from the base of the PR and between 84b447e and 6321d24.

⛔ Files ignored due to path filters (10)
  • src/libs/Together/Generated/Together.BatchesClient.CreateBatches.g.cs is excluded by !**/generated/**
  • src/libs/Together/Generated/Together.ChatClient.ChatCompletions.g.cs is excluded by !**/generated/**
  • src/libs/Together/Generated/Together.ChatClient.ChatCompletionsAsStream.g.cs is excluded by !**/generated/**
  • src/libs/Together/Generated/Together.IBatchesClient.CreateBatches.g.cs is excluded by !**/generated/**
  • src/libs/Together/Generated/Together.IChatClient.ChatCompletions.g.cs is excluded by !**/generated/**
  • src/libs/Together/Generated/Together.IChatClient.ChatCompletionsAsStream.g.cs is excluded by !**/generated/**
  • src/libs/Together/Generated/Together.Models.BatchJob.g.cs is excluded by !**/generated/**
  • src/libs/Together/Generated/Together.Models.ChatCompletionRequest.g.cs is excluded by !**/generated/**
  • src/libs/Together/Generated/Together.Models.ChatCompletionRequestModel.g.cs is excluded by !**/generated/**
  • src/libs/Together/Generated/Together.Models.CreateBatchRequest.g.cs is excluded by !**/generated/**
📒 Files selected for processing (1)
  • src/libs/Together/openapi.yaml

Comment on lines +964 to +976
source: "# Docs for v1 can be found by changing the above selector ^\nfrom together import Together\nimport os\n\nclient = Together(\n api_key=os.environ.get(\"TOGETHER_API_KEY\"),\n)\n\nresponse = client.completions.create(\n model=\"Qwen/Qwen3.5-9B\",\n prompt=\"The largest city in France is\",\n max_tokens=1\n)\n\nprint(response.choices[0].text)\n"
- lang: Python
label: Together AI SDK (v1)
source: "from together import Together\nimport os\n\nclient = Together(\n api_key=os.environ.get(\"TOGETHER_API_KEY\"),\n)\n\nresponse = client.completions.create(\n model=\"meta-llama/Meta-Llama-3.1-8B-Instruct-Turbo\",\n prompt=\"The largest city in France is\",\n max_tokens=1\n)\n\nprint(response.choices[0].text)\n"
source: "from together import Together\nimport os\n\nclient = Together(\n api_key=os.environ.get(\"TOGETHER_API_KEY\"),\n)\n\nresponse = client.completions.create(\n model=\"Qwen/Qwen3.5-9B\",\n prompt=\"The largest city in France is\",\n max_tokens=1\n)\n\nprint(response.choices[0].text)\n"
- lang: TypeScript
label: Together AI SDK (TypeScript)
source: "import Together from \"together-ai\";\n\nconst client = new Together({\n apiKey: process.env.TOGETHER_API_KEY,\n});\n\nconst response = await client.completions.create({\n model: \"meta-llama/Meta-Llama-3.1-8B-Instruct-Turbo\",\n prompt: \"The largest city in France is\",\n max_tokens: 1,\n});\n\nconsole.log(response.choices[0].text);\n"
source: "import Together from \"together-ai\";\n\nconst client = new Together({\n apiKey: process.env.TOGETHER_API_KEY,\n});\n\nconst response = await client.completions.create({\n model: \"Qwen/Qwen3.5-9B\",\n prompt: \"The largest city in France is\",\n max_tokens: 1,\n});\n\nconsole.log(response.choices[0].text);\n"
- lang: JavaScript
label: Together AI SDK (JavaScript)
source: "import Together from \"together-ai\";\n\nconst client = new Together({\n apiKey: process.env.TOGETHER_API_KEY,\n});\n\nconst response = await client.completions.create({\n model: \"meta-llama/Meta-Llama-3.1-8B-Instruct-Turbo\",\n prompt: \"The largest city in France is\",\n max_tokens: 1\n});\n\nconsole.log(response.choices[0].text);\n"
source: "import Together from \"together-ai\";\n\nconst client = new Together({\n apiKey: process.env.TOGETHER_API_KEY,\n});\n\nconst response = await client.completions.create({\n model: \"Qwen/Qwen3.5-9B\",\n prompt: \"The largest city in France is\",\n max_tokens: 1\n});\n\nconsole.log(response.choices[0].text);\n"
- lang: Shell
label: cURL
source: "curl -X POST \"https://api.together.xyz/v1/completions\" \\\n -H \"Authorization: Bearer $TOGETHER_API_KEY\" \\\n -H \"Content-Type: application/json\" \\\n -d '{\n \"model\": \"meta-llama/Meta-Llama-3.1-8B-Instruct-Turbo\",\n \"prompt\": \"The largest city in France is\",\n \"max_tokens\": 1\n }'\n"
source: "curl -X POST \"https://api.together.xyz/v1/completions\" \\\n -H \"Authorization: Bearer $TOGETHER_API_KEY\" \\\n -H \"Content-Type: application/json\" \\\n -d '{\n \"model\": \"Qwen/Qwen3.5-9B\",\n \"prompt\": \"The largest city in France is\",\n \"max_tokens\": 1\n }'\n"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== OpenAPI completions model references =="
rg -n -C2 'CompletionRequest:|Qwen/Qwen3\.5-9B' src/libs/Together/openapi.yaml

echo
echo "== Generated completion model helpers =="
fd 'CompletionRequestModel.*\.g\.cs$' src/libs/Together/Generated | while read -r f; do
  echo "FILE: $f"
  sed -n '1,180p' "$f"
  echo
done

Repository: tryAGI/Together

Length of output: 25191


🏁 Script executed:

sed -n '5518,5700p' src/libs/Together/openapi.yaml

Repository: tryAGI/Together

Length of output: 7405


🏁 Script executed:

sed -n '5826,5880p' src/libs/Together/openapi.yaml

Repository: tryAGI/Together

Length of output: 3233


Add Qwen/Qwen3.5-9B to the CompletionRequest.model enum.

The examples at lines 964–976 advertise Qwen/Qwen3.5-9B, but the OpenAPI schema enum for CompletionRequest.model (lines 5520–5526) does not include it. The generated CompletionRequestModel enum is missing this value. For consistency with the ChatCompletionRequest pattern, which includes this model in both the schema and generated code, add Qwen/Qwen3.5-9B to the CompletionRequest.model enum.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/libs/Together/openapi.yaml` around lines 964 - 976, The
CompletionRequest.model enum in the OpenAPI spec is missing the
"Qwen/Qwen3.5-9B" entry that your examples use; update the schema so the
CompletionRequest.model enum (and thus the generated CompletionRequestModel)
includes the value "Qwen/Qwen3.5-9B" just like ChatCompletionRequest does, then
regenerate the client code so the generated CompletionRequestModel contains that
value and callers using CompletionRequest.model can reference "Qwen/Qwen3.5-9B".

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.

1 participant