OpenAIRefusalError#

class langchain_openai.chat_models.base.OpenAIRefusalError[source]#

Error raised when OpenAI Structured Outputs API returns a refusal.

When using OpenAI’s Structured Outputs API with user-generated input, the model may occasionally refuse to fulfill the request for safety reasons.

See here for more on refusals: https://platform.openai.com/docs/guides/structured-outputs/refusals

New in version 0.1.21.