Skip to content

feat: add warning metadata and summarisation result to response type#152

Merged
lukeocodes merged 2 commits into
mainfrom
lo/sumv2-ga-prep
Jul 19, 2023
Merged

feat: add warning metadata and summarisation result to response type#152
lukeocodes merged 2 commits into
mainfrom
lo/sumv2-ga-prep

Conversation

@lukeocodes

Copy link
Copy Markdown
Member

Add typing for new response format supporting summarisation results and warning metadata.
e.g. output

{
  "metadata": {
    ...
    "warnings": [
      {
        "parameter": "summarize",
        "type": "unsupported_language",
        "message": "Summarization isn’t supported for <detected language>."
      }
    ]
  },
  "results": {
    ...
    "summary": {
      "result": "failure",
      "short": "The summarization feature is currently only available in English. Please check out our API documentation for more details."
    }
  }
}

and

{
  "metadata": {
    ...
    "warnings": [
      {
        "parameter": "filler_words",
        "type": "unsupported_model",
        "message": "Filler Words is not available for the specified model. For supported models, see our docs: <link>"
      },
      {
        "parameter": "numerals",
        "type": "deprecated",
        "message": "The numerals parameter is deprecated. Please use smart_format=true instead. For more information, see our docs: <link>"
      }
    ]
  },
  "results": {
    ...
  }
}

@lukeocodes lukeocodes added the enhancement New feature or request label Jul 13, 2023
@lukeocodes lukeocodes self-assigned this Jul 13, 2023
Comment thread src/types/metadata.ts Outdated
@lukeocodes lukeocodes merged commit 1288778 into main Jul 19, 2023
@lukeocodes lukeocodes deleted the lo/sumv2-ga-prep branch July 19, 2023 17:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants