Skip to content

Add OpenAI Response type JSON schema#238

Open
ledongthuc wants to merge 1 commit into
henomis:mainfrom
ledongthuc:main
Open

Add OpenAI Response type JSON schema#238
ledongthuc wants to merge 1 commit into
henomis:mainfrom
ledongthuc:main

Conversation

@ledongthuc

Copy link
Copy Markdown

Add OpenAI Response type JSON schema

Description

This PR adds support for defining JSON Schema when working with OpenAI through Lingoose. This enhancement allows users to specify the desired response format using JSON Schema, aligning with OpenAI’s structured outputs feature.

The update introduces:

  • A new field to accept a JSON Schema definition.
  • Logic to pass this schema to the OpenAI API when the response format type is set and a schema is provided.

#237

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

  • TestWithResponseFormatJSONSchema

Checklist:

  • I have read the Contributing documentation.
  • I have read the Code of conduct documentation.
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • I have checked my code and corrected any misspellings

Policy on Unattended Pull Requests

As part of our commitment to maintaining an active and collaborative development environment, it's important for pull requests (PRs) to receive timely attention and feedback. PRs left unattended for an extended period can impede progress and create bottlenecks in the development process.

Therefore, if a PR remains unapproved and unmodified following a review for an extended period, the author of the PR reserves the right to implement the suggested modifications at their discretion.

The specific duration of time before this policy is enacted may vary depending on the circumstances and urgency of the changes. However, as a general guideline, a reasonable timeframe for review and action might be 2 weeks.

This policy aims to ensure the continued progress of the project while respecting the contributions and efforts of all team members. It encourages timely collaboration and feedback while preventing PRs from stagnating indefinitely.

If you anticipate being unable to review or address a PR within the specified timeframe, please communicate this with the team to avoid invoking this policy unnecessarily.

@ledongthuc

Copy link
Copy Markdown
Author

@henomis hi, hope it's ok, and could you look at it.
I can support if you need any changes

@henomis

henomis commented May 9, 2025

Copy link
Copy Markdown
Owner

Awesome work! 🚀 I'll test ASAP!

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