openai / openai/openai-java

How to set the responseFormat as JsonSchema without a dedicated record/class

Open
#655 1 comment 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

question sdk
Dominant language
Kotlin
Stars
1.5k
Forks
264
Avg merge
9h 46m
Merged PRs (30d)
96

Description

Hi, let's say I have a Map<String, Object> or even just a String representing a valid Json schema, is there a way to construct the required ResponseFormat? I couldn't find it in the documentation / examples.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the existing ResponseFormat and JsonSchema documentation and examples in the openai-java repository. Clarify whether a Map<String, Object> or a String containing a valid JSON schema can be used without a dedicated record or class, then document the supported construction path and add a corresponding example.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, json
Domain
documentation
Issue type
Documentation
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.