v1

latestOpenAPI 3.0.02026-07-174565114.3 KB
threads

Generate new suggestions

Generates and stores new suggestions for a specific message

post/threads/{id}/messages/{messageId}/suggestions

Path parameters

idstring required
Example:thread_123456789

ID of the thread to generate suggestions for

messageIdstring required
Example:msg_123456789

ID of the message to generate suggestions for

Request body

maxSuggestionsnumber

Maximum number of suggestions to generate

Example request

{
  "availableComponents": [
    {
      "name": "Button",
      "description": "A clickable button component",
      "contextTools": [
        {
          "name": "fetchData",
          "description": "Fetches data for the button",
          "parameters": []
        }
      ],
      "props": {
        "variant": "primary",
        "size": "medium"
      }
    }
  ]
}

Response

New suggestions generated successfully

idstring required

Unique identifier for the suggestion

messageIdstring required

ID of the message this suggestion is for

titlestring required

Short title or summary of the suggestion

detailedSuggestionstring required

Detailed explanation of the suggestion

descriptionstring required

Detailed explanation of the suggestion (alias for detailedSuggestion)

metadataobject

Additional metadata for the suggestion

Example response

[
  {
    "id": "sug_123456789",
    "messageId": "msg_123456789",
    "title": "Add error handling",
    "detailedSuggestion": "Add try-catch block to handle potential API errors",
    "description": "Add try-catch block to handle potential API errors",
    "metadata": {
      "category": "error-handling",
      "priority": "high"
    }
  }
]