Skip to content

feat:Add verbosity property to relevant OpenAPI schemas and update references#208

Merged
HavenDV merged 1 commit intomainfrom
bot/update-openapi_202508081824
Aug 8, 2025
Merged

feat:Add verbosity property to relevant OpenAPI schemas and update references#208
HavenDV merged 1 commit intomainfrom
bot/update-openapi_202508081824

Conversation

@HavenDV
Copy link
Copy Markdown
Contributor

@HavenDV HavenDV commented Aug 8, 2025

Summary by CodeRabbit

  • New Features

    • Added a new "verbosity" option to relevant API configurations, allowing users to control the level of detail in responses.
  • Chores

    • Cleaned up deprecated fields related to verbosity in the API documentation.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Aug 8, 2025

Walkthrough

The OpenAPI specification was updated to add a verbosity property, referencing the Verbosity schema, to multiple components. This property was introduced in relevant schemas and removed from a deprecated section, ensuring its placement aligns with current usage. No logic or control flow changes were made.

Changes

Cohort / File(s) Change Summary
OpenAPI Verbosity Property Updates
src/libs/tryAGI.OpenAI/openapi.yaml
Added verbosity property to multiple schemas, removed it from a deprecated section, and updated references to use the new property placement.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Poem

In the garden of YAML, a property grew,
Verbosity sprouted where old fields withdrew.
No logic was changed, just schemas made neat,
With clarity blooming, the docs are complete.
A hop and a skip—review’s nearly through!
🐇✨

Note

🔌 MCP (Model Context Protocol) integration is now available in Early Access!

Pro users can now connect to remote MCP servers under the Integrations page to get reviews and chat conversations that understand additional development context.

✨ 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_202508081824

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@HavenDV HavenDV enabled auto-merge (squash) August 8, 2025 18:24
@coderabbitai coderabbitai Bot changed the title feat:@coderabbitai feat:Add verbosity property to relevant OpenAPI schemas and update references Aug 8, 2025
Copy link
Copy Markdown

@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: 2

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 4935cd6 and 8c3b355.

⛔ Files ignored due to path filters (5)
  • src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI..JsonSerializerContext.g.cs is excluded by !**/generated/**
  • src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.JsonSerializerContextTypes.g.cs is excluded by !**/generated/**
  • src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.CreateChatCompletionRequestVariant2.g.cs is excluded by !**/generated/**
  • src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.ModelResponseProperties.g.cs is excluded by !**/generated/**
  • src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.ResponsePropertiesText.g.cs is excluded by !**/generated/**
📒 Files selected for processing (1)
  • src/libs/tryAGI.OpenAI/openapi.yaml (2 hunks)

Comment on lines +10369 to +10370
verbosity:
$ref: '#/components/schemas/Verbosity'
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Verification agent

🧩 Analysis chain

Confirm schema existence and decide on nullability/optionality for verbosity.

  • Ensure #/components/schemas/Verbosity exists and is the intended target.
  • Clarify whether verbosity should be nullable (accepts null) and/or optional (omitted when unspecified). Current addition has no nullable: true unlike neighboring fields such as logprobs.

If you intend to allow nulls at the property level, this minimal change is typical for OAS 3.0:

             verbosity:
               $ref: '#/components/schemas/Verbosity'
+              nullable: true

Alternatively, make Verbosity itself nullable (applies to all references), or keep it non-nullable and simply omit it from the required list to make it optional.

Run this script to verify the Verbosity schema exists, find all verbosity properties, and check their $ref and nullable usage, plus whether any schema marks it as required:


🏁 Script executed:

#!/bin/bash
set -euo pipefail

pip -q install pyyaml >/dev/null

FILE="$(fd -a 'openapi.yaml' | head -n1)"
if [[ -z "${FILE}" ]]; then
  echo "ERROR: openapi.yaml not found"
  exit 2
fi

python - << 'PY'
import sys, json, yaml, os
path = os.popen("fd -a openapi.yaml").read().strip().splitlines()[0]
with open(path, 'r', encoding='utf-8') as f:
    doc = yaml.safe_load(f)

schemas = (((doc or {}).get('components') or {}).get('schemas') or {})
verbosity_schema = schemas.get('Verbosity')
print("Verbosity schema exists:", bool(verbosity_schema))
if not verbosity_schema:
    sys.exit(1)

matches = []
def walk(node, path):
    if isinstance(node, dict):
        props = node.get('properties')
        if isinstance(props, dict) and 'verbosity' in props:
            p = props['verbosity']
            matches.append({
                'path': '/'.join(path+['properties','verbosity']),
                'has_ref': '$ref' in p,
                'ref': p.get('$ref'),
                'nullable': p.get('nullable'),
            })
        for k, v in node.items():
            walk(v, path+[str(k)])
    elif isinstance(node, list):
        for i, v in enumerate(node):
            walk(v, path+[str(i)])

walk(doc, [])
print("Found verbosity properties:", len(matches))
print(json.dumps(matches, indent=2))

required_hits = []
def reqwalk(node, path):
    if isinstance(node, dict):
        if isinstance(node.get('required'), list) and 'verbosity' in node['required']:
            required_hits.append('/'.join(path+['required']))
        for k, v in node.items():
            reqwalk(v, path+[str(k)])
    elif isinstance(node, list):
        for i, v in enumerate(node):
            reqwalk(v, path+[str(i)])

reqwalk(doc, [])
print("Required arrays containing 'verbosity':", required_hits)
PY

Length of output: 695


Confirm Verbosity schema and nullability for verbosity properties

  • The #/components/schemas/Verbosity schema exists.
  • There are two references to verbosity (both have $ref: '#/components/schemas/Verbosity' and no nullable):
    • components/schemas/CreateChatCompletionRequest/allOf/1/properties/verbosity
    • components/schemas/ResponseProperties/properties/text/properties/verbosity
  • Neither reference is marked required, so both fields are already optional.

If you need to allow null values, add nullable: true to each property. For example:

 components/schemas/CreateChatCompletionRequest:
   allOf:
     - $ref: '#/components/schemas/BaseRequest'
     - properties:
         verbosity:
           $ref: '#/components/schemas/Verbosity'
+          nullable: true

 components/schemas/ResponseProperties:
   properties:
     text:
       properties:
         verbosity:
           $ref: '#/components/schemas/Verbosity'
+          nullable: true

If you prefer to keep verbosity non-nullable, no changes are needed beyond omitting it from any required lists.

Committable suggestion skipped: line range outside the PR's diff.

🤖 Prompt for AI Agents
In src/libs/tryAGI.OpenAI/openapi.yaml around lines 10369 to 10370, verify the
intended nullability of the verbosity properties referencing the Verbosity
schema. If null values should be allowed, add "nullable: true" to both verbosity
properties under CreateChatCompletionRequest and ResponseProperties/text. If
null values are not allowed, no changes are needed since these properties are
already optional by not being in any required list.

Comment on lines +22712 to +22713
verbosity:
$ref: '#/components/schemas/Verbosity'
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Verification agent

🧩 Analysis chain

Align verbosity semantics across response config and parent schema; check SDK/codegen impact.

  • Keep verbosity’s nullability/optionality consistent everywhere it appears. If nulls are allowed elsewhere, mirror that here.
  • Adding a property to response config may affect generated SDKs/types. Ensure codegen and downstream typing/tests are updated.

If nulls should be accepted here too (OAS 3.0):

            verbosity:
              $ref: '#/components/schemas/Verbosity'
+             nullable: true

To spot potential breakage and ensure consistent usage across the repo:


🏁 Script executed:

#!/bin/bash
set -euo pipefail

# List all occurrences of 'Verbosity' schema and 'verbosity' property
rg -n -A2 -B2 '^\s*Verbosity:|^\s*verbosity:' -- src

# Check if any client/SDK code references response config fields near this addition
rg -n -A4 -B4 'TextResponseFormatConfiguration|verbosity' -- .

# If you rely on codegen, ensure manifests/configs mention this OpenAPI file
fd 'openapi' -e yaml -e yml -e json

Length of output: 72719


Add nullable: true to the new verbosity property and regenerate SDK

The verbosity field under TextResponseFormatConfiguration (at line 22712) is currently missing its nullable: true annotation, unlike the earlier occurrence at line 10369. Update the OpenAPI spec and then re-run codegen to keep downstream types and tests in sync.

• File: src/libs/tryAGI.OpenAI/openapi.yaml
Location: around line 22712

Suggested diff:

             verbosity:
               $ref: '#/components/schemas/Verbosity'
+              nullable: true

After applying this change, regenerate the client SDK/types and verify any impacted tests or type declarations.

Committable suggestion skipped: line range outside the PR's diff.

🤖 Prompt for AI Agents
In src/libs/tryAGI.OpenAI/openapi.yaml around line 22712, the `verbosity`
property under `TextResponseFormatConfiguration` is missing the `nullable: true`
annotation. Add `nullable: true` to this property in the OpenAPI spec, then
regenerate the client SDK and update any affected tests or type declarations to
keep everything consistent.

@HavenDV HavenDV disabled auto-merge August 8, 2025 19:09
@HavenDV HavenDV merged commit ac1d1e3 into main Aug 8, 2025
3 of 4 checks passed
@HavenDV HavenDV deleted the bot/update-openapi_202508081824 branch August 8, 2025 19:09
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