Skip to content

feat:Update OpenAPI spec for audio streaming, usage data, and code tool schemas#182

Merged
HavenDV merged 1 commit intomainfrom
bot/update-openapi_202506231823
Jun 23, 2025
Merged

feat:Update OpenAPI spec for audio streaming, usage data, and code tool schemas#182
HavenDV merged 1 commit intomainfrom
bot/update-openapi_202506231823

Conversation

@HavenDV
Copy link
Copy Markdown
Contributor

@HavenDV HavenDV commented Jun 23, 2025

Summary by CodeRabbit

  • New Features

    • Added streaming support for speech synthesis, allowing audio to be received in real time.
    • Enhanced transcription responses with detailed usage information, including token or duration-based statistics.
    • File citations now include an optional filename property.
  • Improvements

    • Updated code interpreter outputs to better distinguish between logs and images.
    • Clarified and improved descriptions and examples throughout the documentation for greater accuracy.
  • Bug Fixes

    • Corrected JavaScript example for deleting responses.
  • Documentation

    • Updated examples for fine-tuning checkpoints and improved formatting for clarity.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Jun 23, 2025

Walkthrough

The OpenAPI specification was updated to add streaming support for speech audio endpoints, enrich transcription responses with usage data, and revise code interpreter tool call schemas and related streaming events. New schemas for audio streaming, usage statistics, and code interpreter outputs were introduced, while examples and descriptions were clarified and corrected.

Changes

File(s) Change Summary
src/libs/tryAGI.OpenAI/openapi.yaml Added streaming support for /audio/speech, new schemas for audio events and usage stats, revised code interpreter tool call/output schemas, updated event schemas to use item_id, improved examples, and clarified descriptions.

Sequence Diagram(s)

sequenceDiagram
    participant Client
    participant API

    Client->>API: POST /audio/speech (request with text)
    alt Streaming enabled (text/event-stream)
        loop While audio chunks available
            API-->>Client: SpeechAudioDeltaEvent (audio chunk)
        end
        API-->>Client: SpeechAudioDoneEvent (completion, usage stats)
    else Full audio
        API-->>Client: Audio file (audio/mpeg or similar)
    end
Loading
sequenceDiagram
    participant Client
    participant API

    Client->>API: POST /audio/transcriptions (audio file)
    API-->>Client: Transcription response (includes usage: tokens or duration)
Loading
sequenceDiagram
    participant Client
    participant API

    Client->>API: Code interpreter tool call
    API-->>Client: Response events (with item_id, outputs: logs/images)
Loading

Poem

🐇
Streaming voices hop and play,
Usage stats now light the way.
Code interpreter, neat and spry,
Sends logs and pictures flying by.
Examples polished, schemas new—
This OpenAPI grew and grew!

✨ Finishing Touches
🧪 Generate Unit Tests
  • Create PR with Unit Tests
  • Post Copyable Unit Tests in Comment
  • Commit Unit Tests in branch bot/update-openapi_202506231823

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.
    • @coderabbitai modularize this function.
  • 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.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

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

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

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 auto-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) June 23, 2025 18:24
@coderabbitai coderabbitai Bot changed the title feat:@coderabbitai feat:Update OpenAPI spec for audio streaming, usage data, and code tool schemas Jun 23, 2025
@HavenDV HavenDV merged commit 8639b99 into main Jun 23, 2025
3 of 4 checks passed
@HavenDV HavenDV deleted the bot/update-openapi_202506231823 branch June 23, 2025 18:28
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: 3

🧹 Nitpick comments (2)
src/libs/tryAGI.OpenAI/openapi.yaml (2)

9188-9223: Add URI format to image URL.
Consider adding format: uri under the url property in CodeInterpreterOutputImage for stronger schema validation.


11840-11846: Harmonize description quoting.
The multi-line description uses both quotes and backticks. Consider standardizing to single-quote YAML style and escaping backticks for readability.

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 47ecd99 and 7c97e67.

⛔ Files ignored due to path filters (76)
  • src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI..JsonSerializerContext.g.cs is excluded by !**/generated/**
  • src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.AudioClient.CreateSpeech.g.cs is excluded by !**/generated/**
  • src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.IAudioClient.CreateSpeech.g.cs is excluded by !**/generated/**
  • src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.JsonConverters.CodeInterpreterOutputImageType.g.cs is excluded by !**/generated/**
  • src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.JsonConverters.CodeInterpreterOutputImageTypeNullable.g.cs is excluded by !**/generated/**
  • src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.JsonConverters.CodeInterpreterOutputLogsType.g.cs is excluded by !**/generated/**
  • src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.JsonConverters.CodeInterpreterOutputLogsTypeNullable.g.cs is excluded by !**/generated/**
  • src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.JsonConverters.Container.g.cs is excluded by !**/generated/**
  • src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.JsonConverters.CreateSpeechRequestStreamFormat.g.cs is excluded by !**/generated/**
  • src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.JsonConverters.CreateSpeechRequestStreamFormatNullable.g.cs is excluded by !**/generated/**
  • src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.JsonConverters.CreateSpeechResponseStreamEvent.g.cs is excluded by !**/generated/**
  • src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.JsonConverters.RealtimeSessionCreateRequestClientSecretExpiresAfterAnchor.g.cs is excluded by !**/generated/**
  • src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.JsonConverters.RealtimeSessionCreateRequestClientSecretExpiresAfterAnchorNullable.g.cs is excluded by !**/generated/**
  • src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.JsonConverters.SpeechAudioDeltaEventType.g.cs is excluded by !**/generated/**
  • src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.JsonConverters.SpeechAudioDeltaEventTypeNullable.g.cs is excluded by !**/generated/**
  • src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.JsonConverters.SpeechAudioDoneEventType.g.cs is excluded by !**/generated/**
  • src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.JsonConverters.SpeechAudioDoneEventTypeNullable.g.cs is excluded by !**/generated/**
  • src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.JsonConverters.TranscriptTextUsageDurationType.g.cs is excluded by !**/generated/**
  • src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.JsonConverters.TranscriptTextUsageDurationTypeNullable.g.cs is excluded by !**/generated/**
  • src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.JsonConverters.TranscriptTextUsageTokensType.g.cs is excluded by !**/generated/**
  • src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.JsonConverters.TranscriptTextUsageTokensTypeNullable.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.CodeInterpreterOutputImage.Json.g.cs is excluded by !**/generated/**
  • src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.CodeInterpreterOutputImage.g.cs is excluded by !**/generated/**
  • src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.CodeInterpreterOutputImageType.g.cs is excluded by !**/generated/**
  • src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.CodeInterpreterOutputLogs.Json.g.cs is excluded by !**/generated/**
  • src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.CodeInterpreterOutputLogs.g.cs is excluded by !**/generated/**
  • src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.CodeInterpreterOutputLogsType.g.cs is excluded by !**/generated/**
  • src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.CodeInterpreterTool.g.cs is excluded by !**/generated/**
  • src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.CodeInterpreterToolCall.g.cs is excluded by !**/generated/**
  • src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.CodeInterpreterToolCallOutputsDiscriminator.Json.g.cs is excluded by !**/generated/**
  • src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.CodeInterpreterToolCallOutputsDiscriminator.g.cs is excluded by !**/generated/**
  • src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.CodeInterpreterToolCallStatus.g.cs is excluded by !**/generated/**
  • src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.CodeInterpreterToolCallType.g.cs is excluded by !**/generated/**
  • src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.CodeInterpreterToolOutput.g.cs is excluded by !**/generated/**
  • src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.Container.g.cs is excluded by !**/generated/**
  • src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.ContainerFileCitationBody.g.cs is excluded by !**/generated/**
  • src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.CreateSpeechRequest.g.cs is excluded by !**/generated/**
  • src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.CreateSpeechRequestStreamFormat.g.cs is excluded by !**/generated/**
  • src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.CreateSpeechResponseStreamEvent.Json.g.cs is excluded by !**/generated/**
  • src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.CreateSpeechResponseStreamEvent.g.cs is excluded by !**/generated/**
  • src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.CreateSpeechResponseStreamEventDiscriminator.Json.g.cs is excluded by !**/generated/**
  • src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.CreateSpeechResponseStreamEventDiscriminator.g.cs is excluded by !**/generated/**
  • src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.CreateTranscriptionResponseJson.g.cs is excluded by !**/generated/**
  • src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.CreateTranscriptionResponseVerboseJson.g.cs is excluded by !**/generated/**
  • src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.FileCitationBody.g.cs is excluded by !**/generated/**
  • src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.RealtimeServerEventConversationItemInputAudioTranscriptionCompleted.g.cs is excluded by !**/generated/**
  • src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.RealtimeSessionCreateRequestClientSecret.g.cs is excluded by !**/generated/**
  • src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.RealtimeSessionCreateRequestClientSecretExpiresAfter.Json.g.cs is excluded by !**/generated/**
  • src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.RealtimeSessionCreateRequestClientSecretExpiresAfter.g.cs is excluded by !**/generated/**
  • src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.RealtimeSessionCreateRequestClientSecretExpiresAfterAnchor.g.cs is excluded by !**/generated/**
  • src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.RealtimeSessionCreateResponse.g.cs is excluded by !**/generated/**
  • src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.RealtimeSessionCreateResponseInputAudioTranscription.g.cs is excluded by !**/generated/**
  • src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.ResponseCodeInterpreterCallCodeDeltaEvent.g.cs is excluded by !**/generated/**
  • src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.ResponseCodeInterpreterCallCodeDoneEvent.g.cs is excluded by !**/generated/**
  • src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.ResponseCodeInterpreterCallCompletedEvent.g.cs is excluded by !**/generated/**
  • src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.ResponseCodeInterpreterCallInProgressEvent.g.cs is excluded by !**/generated/**
  • src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.ResponseCodeInterpreterCallInterpretingEvent.g.cs is excluded by !**/generated/**
  • src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.ResponseStreamEvent.g.cs is excluded by !**/generated/**
  • src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.SpeechAudioDeltaEvent.Json.g.cs is excluded by !**/generated/**
  • src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.SpeechAudioDeltaEvent.g.cs is excluded by !**/generated/**
  • src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.SpeechAudioDeltaEventType.g.cs is excluded by !**/generated/**
  • src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.SpeechAudioDoneEvent.Json.g.cs is excluded by !**/generated/**
  • src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.SpeechAudioDoneEvent.g.cs is excluded by !**/generated/**
  • src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.SpeechAudioDoneEventType.g.cs is excluded by !**/generated/**
  • src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.SpeechAudioDoneEventUsage.Json.g.cs is excluded by !**/generated/**
  • src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.SpeechAudioDoneEventUsage.g.cs is excluded by !**/generated/**
  • src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.TranscriptTextDoneEvent.g.cs is excluded by !**/generated/**
  • src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.TranscriptTextUsageDuration.Json.g.cs is excluded by !**/generated/**
  • src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.TranscriptTextUsageDuration.g.cs is excluded by !**/generated/**
  • src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.TranscriptTextUsageDurationType.g.cs is excluded by !**/generated/**
  • src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.TranscriptTextUsageTokens.Json.g.cs is excluded by !**/generated/**
  • src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.TranscriptTextUsageTokens.g.cs is excluded by !**/generated/**
  • src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.TranscriptTextUsageTokensInputTokenDetails.Json.g.cs is excluded by !**/generated/**
  • src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.TranscriptTextUsageTokensInputTokenDetails.g.cs is excluded by !**/generated/**
  • src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.TranscriptTextUsageTokensType.g.cs is excluded by !**/generated/**
📒 Files selected for processing (1)
  • src/libs/tryAGI.OpenAI/openapi.yaml (29 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: Test / Build, test and publish
🔇 Additional comments (24)
src/libs/tryAGI.OpenAI/openapi.yaml (24)

307-310: Transcription example includes usage field.
The JSON example now shows a usage object with token counts, matching the new schemas (TranscriptTextUsageTokens). Looks correct.


318-322: Streaming transcription deltas include logprobs.
The transcript.text.delta stream example correctly embeds logprobs. This aligns with the updated schema.


329-333: Verbose transcription logprobs example updated with usage.
The example now includes a usage block for token-usage billing. Schema alignment is correct.


341-344: Word timestamps example includes duration usage.
The example’s usage property uses the duration variant as expected.


353-357: Segment timestamps example includes duration usage.
The segments example was updated to include a usage object with seconds. Good.


2169-2174: Simplified permissions retrieval example.
Examples now directly retrieve first_id instead of iterating pages, which simplifies usage.


5440-5440: Corrected delete method name in JavaScript.
Changed from del to delete to match the client API.


9279-9326: Update CodeInterpreterToolCall schema.
container_id, code, and outputs have been added and results removed, aligning the schema with the new tool call contract.


11998-12010: Verify SSE support constraints.
stream_format now accepts sse and audio, with sse not supported for tts-1 or tts-1-hd. Confirm that downstream clients (e.g., gpt-4o-mini-tts) are correctly flagged if SSE is unavailable.


12344-12349: Add usage object to transcription response schema.
The new usage oneOf reference correctly ties to token/duration usage variants.


12385-12388: Include usage in verbose transcription schema.
New usage reference for verbose JSON is aligned with duration-metered billing.


18147-18150: Clarify input audio transcription event docs.
Expanded description under conversation.item.input_audio_transcription.completed provides necessary context.


19507-19509: Enhance model description in transcription config.
The added description clarifies the model field’s purpose.


20072-20077: Include item_id in delta event required list.
Adding item_id ensures all code-interpreter delta events carry the tool-call identifier.


20083-20094: Document delta event properties.
Explicit description fields were added for type, output_index, delta, and sequence_number, improving schema clarity.


20112-20123: Document done event properties.
The response.code_interpreter_call_code.done event now includes descriptions for item_id, code, and sequence_number. Looks correct.


23094-23147: Add speech audio streaming events.
Schemas SpeechAudioDeltaEvent and SpeechAudioDoneEvent are properly defined with required fields and usage stats.


23476-23500: Define transcription usage schemas.
TranscriptTextUsageDuration and TranscriptTextUsageTokens are correctly introduced for dual billing models.


24999-25003: Add filename to file citation.
Including filename provides clarity in the citation object; ensure client libraries handle this new field.


25018-25020: Document citation filename.
The filename description clarifies its purpose in file lists.


25060-25061: Extend URL citation with filename.
Adding filename aligns URL citations with other citation schemas.


25082-25084: Add container filename to citation.
New filename property provides context for container file citations.


26856-26870: Register code-interpreter events in mappings.
All new ResponseCodeInterpreterCall* event keys have been added to the top-level event list.


27101-27106: Expose speech-audio event docs in nav.
Entries for SpeechAudioDeltaEvent and SpeechAudioDoneEvent are now included in the mapping for generated docs.

Comment on lines +242 to +244
text/event-stream:
schema:
$ref: '#/components/schemas/CreateSpeechResponseStreamEvent'
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue

Fix Node.js SSE example.
The SSE (text/event-stream) example still uses blob-based file writes instead of a streaming client (e.g., EventSource or fetch with ReadableStream). Update the Node.js snippet to illustrate proper SSE consumption.

Also applies to: 248-266

🤖 Prompt for AI Agents
In src/libs/tryAGI.OpenAI/openapi.yaml between lines 242 to 244 and 248 to 266,
the Node.js SSE example incorrectly uses blob-based file writes instead of a
streaming client. Update the example to use a proper SSE consumption method such
as the EventSource API or fetch with ReadableStream to handle the
'text/event-stream' response correctly. Replace the blob handling code with
streaming logic that processes incoming events as they arrive.

Comment on lines 2494 to 2500
group: fine-tuning
returns: 'A list of fine-tuning [checkpoint objects](/docs/api-reference/fine-tuning/checkpoint-object) for a fine-tuning job.'
examples:
response: "{\n \"object\": \"list\"\n \"data\": [\n {\n \"object\": \"fine_tuning.job.checkpoint\",\n \"id\": \"ftckpt_zc4Q7MP6XxulcVzj4MZdwsAB\",\n \"created_at\": 1721764867,\n \"fine_tuned_model_checkpoint\": \"ft:gpt-4o-mini-2024-07-18:my-org:custom-suffix:96olL566:ckpt-step-2000\",\n \"metrics\": {\n \"full_valid_loss\": 0.134,\n \"full_valid_mean_token_accuracy\": 0.874\n },\n \"fine_tuning_job_id\": \"ftjob-abc123\",\n \"step_number\": 2000,\n },\n {\n \"object\": \"fine_tuning.job.checkpoint\",\n \"id\": \"ftckpt_enQCFmOTGj3syEpYVhBRLTSy\",\n \"created_at\": 1721764800,\n \"fine_tuned_model_checkpoint\": \"ft:gpt-4o-mini-2024-07-18:my-org:custom-suffix:7q8mpxmy:ckpt-step-1000\",\n \"metrics\": {\n \"full_valid_loss\": 0.167,\n \"full_valid_mean_token_accuracy\": 0.781\n },\n \"fine_tuning_job_id\": \"ftjob-abc123\",\n \"step_number\": 1000,\n },\n ],\n \"first_id\": \"ftckpt_zc4Q7MP6XxulcVzj4MZdwsAB\",\n \"last_id\": \"ftckpt_enQCFmOTGj3syEpYVhBRLTSy\",\n \"has_more\": true\n}\n"
response: "{\n \"object\": \"list\",\n \"data\": [\n {\n \"object\": \"fine_tuning.job.checkpoint\",\n \"id\": \"ftckpt_zc4Q7MP6XxulcVzj4MZdwsAB\",\n \"created_at\": 1721764867,\n \"fine_tuned_model_checkpoint\": \"ft:gpt-4o-mini-2024-07-18:my-org:custom-suffix:96olL566:ckpt-step-2000\",\n \"metrics\": {\n \"full_valid_loss\": 0.134,\n \"full_valid_mean_token_accuracy\": 0.874\n },\n \"fine_tuning_job_id\": \"ftjob-abc123\",\n \"step_number\": 2000\n },\n {\n \"object\": \"fine_tuning.job.checkpoint\",\n \"id\": \"ftckpt_enQCFmOTGj3syEpYVhBRLTSy\",\n \"created_at\": 1721764800,\n \"fine_tuned_model_checkpoint\": \"ft:gpt-4o-mini-2024-07-18:my-org:custom-suffix:7q8mpxmy:ckpt-step-1000\",\n \"metrics\": {\n \"full_valid_loss\": 0.167,\n \"full_valid_mean_token_accuracy\": 0.781\n },\n \"fine_tuning_job_id\": \"ftjob-abc123\",\n \"step_number\": 1000\n }\n ],\n \"first_id\": \"ftckpt_zc4Q7MP6XxulcVzj4MZdwsAB\",\n \"last_id\": \"ftckpt_enQCFmOTGj3syEpYVhBRLTSy\",\n \"has_more\": true\n}\n"
request:
curl: "curl https://api.openai.com/v1/fine_tuning/jobs/ftjob-abc123/checkpoints \\\n -H \"Authorization: Bearer $OPENAI_API_KEY\"\n"
node.js: "import OpenAI from 'openai';\n\nconst client = new OpenAI({\n apiKey: process.env['OPENAI_API_KEY'], // This is the default and can be omitted\n});\n\n// Automatically fetches more pages as needed.\nfor await (const fineTuningJobCheckpoint of client.fineTuning.jobs.checkpoints.list(\n 'ft-AF1WoRqd3aJAHsqc9NY7iL8F',\n)) {\n console.log(fineTuningJobCheckpoint.id);\n}"
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue

Mismatch in checkpoint list ID examples.
The curl and Node.js examples use different checkpoint identifiers (ftjob-abc123 vs. ft-AF1WoRqd3aJAHsqc9NY7iL8F). Align these IDs for consistency.

🤖 Prompt for AI Agents
In src/libs/tryAGI.OpenAI/openapi.yaml around lines 2494 to 2500, the checkpoint
list ID examples in the curl and Node.js sections are inconsistent, using
`ftjob-abc123` in one and `ft-AF1WoRqd3aJAHsqc9NY7iL8F` in the other. Update the
examples so both use the same checkpoint identifier to maintain consistency
across the documentation.

Comment on lines +19449 to 19460
expires_after:
required:
- anchor
type: object
properties:
anchor:
enum:
- created_at
type: string
description: "The anchor point for the ephemeral token expiration. Only `created_at` is currently supported.\n"
default: created_at
seconds:
type: integer
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue

Enforce expires_after.seconds requirement.
expires_after now requires anchor but omits a required: - seconds block. This allows seconds to be absent; please add seconds to the required list.

🤖 Prompt for AI Agents
In src/libs/tryAGI.OpenAI/openapi.yaml around lines 19449 to 19460, the
expires_after object includes an anchor but does not list seconds as a required
property. To fix this, add seconds to the required array under expires_after to
ensure it is always present as mandated.

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