Skip to content

Generate Structured Prompt from Diff

Request

Generates a new, optimized structured_prompt by analyzing the semantic difference between an original structred_prompt and a user-edited version. This endpoint is relevant for applications that allow for manual inline structured_prompt editing.

Security
api_token
Bodyapplication/json
structured_promptstringrequired

A string containing the original structured prompt in JSON format.

user_adjusted_structured_promptstringrequired

A string containing the manually modified structured prompt in JSON format.

seedinteger

Seed for deterministic generation. Uses a random seed if omitted.

syncboolean

Response mode.

  • false (default): Asynchronous. Returns 202.
  • true: Synchronous. Returns 200 with result.
Default:false
webhook_urlstring, (uri)

Optional URL for receiving the result via webhook when the async job completes. See webhooks.

model_versionstring

Generation model version.

Value:"FIBO"
POST
/structured_prompt/generate_from_diff
from bria_client import BriaSyncClient

client = BriaSyncClient()  # reads BRIA_API_TOKEN

response = client.run(
    endpoint="structured_prompt/generate_from_diff",
    payload={
        "structured_prompt": "<structured_prompt>",
        "user_adjusted_structured_prompt": "<user_adjusted_structured_prompt>",
    },
)
print(response.result.structured_prompt)

Responses

Successful operation (Synchronous Success)

Bodyapplication/json
resultobjectrequired
request_idstringrequired
warningstring

Returned only when ip_signal = true and the prompt field included IP content.

Response
{ "result": { "seed": 0, "structured_prompt": "string" }, "request_id": "string", "warning": "string" }