feat:Add verbosity property to relevant OpenAPI schemas and update references#208
feat:Add verbosity property to relevant OpenAPI schemas and update references#208
Conversation
WalkthroughThe OpenAPI specification was updated to add a Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Poem
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
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Actionable comments posted: 2
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (5)
src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI..JsonSerializerContext.g.csis excluded by!**/generated/**src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.JsonSerializerContextTypes.g.csis excluded by!**/generated/**src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.CreateChatCompletionRequestVariant2.g.csis excluded by!**/generated/**src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.ModelResponseProperties.g.csis excluded by!**/generated/**src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.ResponsePropertiesText.g.csis excluded by!**/generated/**
📒 Files selected for processing (1)
src/libs/tryAGI.OpenAI/openapi.yaml(2 hunks)
| verbosity: | ||
| $ref: '#/components/schemas/Verbosity' |
There was a problem hiding this comment.
💡 Verification agent
🧩 Analysis chain
Confirm schema existence and decide on nullability/optionality for verbosity.
- Ensure
#/components/schemas/Verbosityexists and is the intended target. - Clarify whether
verbosityshould be nullable (accepts null) and/or optional (omitted when unspecified). Current addition has nonullable: trueunlike neighboring fields such aslogprobs.
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: trueAlternatively, 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)
PYLength of output: 695
Confirm Verbosity schema and nullability for verbosity properties
- The
#/components/schemas/Verbosityschema exists. - There are two references to
verbosity(both have$ref: '#/components/schemas/Verbosity'and nonullable):components/schemas/CreateChatCompletionRequest/allOf/1/properties/verbositycomponents/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: trueIf 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.
| verbosity: | ||
| $ref: '#/components/schemas/Verbosity' |
There was a problem hiding this comment.
💡 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: trueTo 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 jsonLength 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: trueAfter 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.
Summary by CodeRabbit
New Features
Chores