Skip to content

Conversation

@HavenDV
Copy link
Contributor

@HavenDV HavenDV commented Sep 25, 2025

Summary by CodeRabbit

  • New Features
    • Added optional “reasoning” settings to chat requests and individual user messages, enabling you to toggle reasoning on/off and choose effort levels (low, medium, high).
    • Provides finer control over response depth and trade-offs between quality, latency, and cost.
    • Backward compatible: existing integrations work unchanged if reasoning is not specified.

@coderabbitai
Copy link

coderabbitai bot commented Sep 25, 2025

Walkthrough

Adds a new ChatReasoningSettings schema and introduces an optional reasoning field to OpenAIChatCompletionsIn and ChatCompletionUserMessage in src/libs/DeepInfra/openapi.yaml.

Changes

Cohort / File(s) Summary of Changes
OpenAPI schema updates
src/libs/DeepInfra/openapi.yaml
Added public schema ChatReasoningSettings with fields: effort (enum: low, medium, high) and enabled (boolean). Added optional reasoning field referencing ChatReasoningSettings to OpenAIChatCompletionsIn and ChatCompletionUserMessage.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  actor Dev as Client
  participant API as DeepInfra API
  participant Model as Chat Model

  Dev->>API: POST /chat/completions { messages[], reasoning{enabled, effort} }
  API->>API: Validate schema (reasoning optional)
  alt reasoning.enabled == true
    API->>Model: Invoke with reasoning settings (effort)
  else reasoning.enabled == false or absent
    API->>Model: Invoke without reasoning
  end
  Model-->>API: Completion response
  API-->>Dev: 200 OK { choices[], usage... }
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Poem

A bunny tweaks the schema file,
Adds “reasoning” with measured style.
Low, medium, high—efforts aligned,
Toggle on, or leave behind.
Hop, hop—the YAML sings,
Clear paths for thoughtful things.

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Title Check ⚠️ Warning The pull request title “feat:@coderabbitai” does not convey the actual changes introduced, such as the addition of the ChatReasoningSettings schema and new reasoning fields in the OpenAPI spec, making it unclear and unrelated to the main change. Please update the title to clearly summarize the primary change, for example “feat: add ChatReasoningSettings schema and reasoning fields to openapi.yaml” so it accurately reflects the content of the pull request.
✅ Passed checks (2 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 changes. Docstring coverage check skipped.
✨ Finishing touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch bot/update-openapi_202509250628

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between fb29150 and 65b4471.

⛔ Files ignored due to path filters (12)
  • src/libs/DeepInfra/Generated/DeepInfra..JsonSerializerContext.g.cs is excluded by !**/generated/**
  • src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.OpenaiChatCompletions.g.cs is excluded by !**/generated/**
  • src/libs/DeepInfra/Generated/DeepInfra.DeepInfraClient.OpenaiChatCompletions2.g.cs is excluded by !**/generated/**
  • src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.OpenaiChatCompletions.g.cs is excluded by !**/generated/**
  • src/libs/DeepInfra/Generated/DeepInfra.IDeepInfraClient.OpenaiChatCompletions2.g.cs is excluded by !**/generated/**
  • src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.ChatReasoningSettingsEffort.g.cs is excluded by !**/generated/**
  • src/libs/DeepInfra/Generated/DeepInfra.JsonConverters.ChatReasoningSettingsEffortNullable.g.cs is excluded by !**/generated/**
  • src/libs/DeepInfra/Generated/DeepInfra.JsonSerializerContextTypes.g.cs is excluded by !**/generated/**
  • src/libs/DeepInfra/Generated/DeepInfra.Models.ChatReasoningSettings.Json.g.cs is excluded by !**/generated/**
  • src/libs/DeepInfra/Generated/DeepInfra.Models.ChatReasoningSettings.g.cs is excluded by !**/generated/**
  • src/libs/DeepInfra/Generated/DeepInfra.Models.ChatReasoningSettingsEffort.g.cs is excluded by !**/generated/**
  • src/libs/DeepInfra/Generated/DeepInfra.Models.OpenAIChatCompletionsIn.g.cs is excluded by !**/generated/**
📒 Files selected for processing (1)
  • src/libs/DeepInfra/openapi.yaml (2 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Test / Build, test and publish
🔇 Additional comments (2)
src/libs/DeepInfra/openapi.yaml (2)

5554-5571: LGTM – new schema is well-scoped.

ChatReasoningSettings cleanly models the feature toggle and effort level.


7549-7550: LGTM – property wiring matches the new schema.

reasoning now references ChatReasoningSettings, keeping the request surface coherent.


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 enabled auto-merge (squash) September 25, 2025 06:29
@HavenDV HavenDV merged commit d6b5a45 into main Sep 25, 2025
3 of 4 checks passed
@HavenDV HavenDV deleted the bot/update-openapi_202509250628 branch September 25, 2025 06:31
@coderabbitai coderabbitai bot changed the title feat:@coderabbitai feat:Add ChatReasoningSettings and reasoning to chat types in openapi.yaml Sep 25, 2025
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.

2 participants