Shopify / Shopify/roast

Add config method to parse prose output into structured JSON via a lightweight model

Open
#1,011 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Ruby
Stars
1.2k
Forks
76
PR merge metrics
No merged PRs in 30d

Description

Follow-up to #1007. Add a config method that runs a small/cheap LLM to coerce a cog's prose prompt into a call to the structured JSON method.

This would allow users to set something like: "Output a Json with the names, followed by the emails" and the lightweight model infers the corresponding schema and wires it into the structured-output method from #1007, so the primary model's response is forced to that shape. No hand-written schema required.

config do
  chat(:extract) do
    generate_schema_with "gpt-4o"
  end
end

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 reading the structured JSON method described in follow-up issue #1007 and the configuration pattern shown in this issue. Trace how a cog's prose prompt reaches the primary model, then determine how generate_schema_with "gpt-4o" should connect schema inference to structured output. Done means users can provide the prose prompt without a hand-written schema and receive the requested JSON shape.

Written by the indexing model from the issue text.

Assessment

Tech stack
ruby
Domain
ai, backend-api-design
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.