PyRIT icon indicating copy to clipboard operation
PyRIT copied to clipboard

FEAT: Centralize Exception Handling and Implement in GPTv Target

Open rdheekonda opened this issue 1 year ago • 1 comments

  1. Centralized Exception Handling
  2. Adding exception handling to the Azure OpenAI GPT V chat target to manage bad request errors, authentication errors, empty response and rate limit errors.
  3. Added section in contributing guide

Description

Tests and Documentation

Added tests

rdheekonda avatar May 15 '24 23:05 rdheekonda

As part of this, can you take a stab at documenting what we should do? E.g. this is my best stab at a strategy, which is similar to but different from the one you have coded

  • If the output is None or JSON can't parse (there is no json in this target but a lot of our scorers and stuff use json), retry a few times then process_exception
  • If there is a RateLimitError, retry a few times then process_exception
  • If there is an auth error, raise (stops execution).. this may not need a special case if our default is to raise
  • If there is a BadRequestError caused by the filter, do not retry and process_exception. If BadRequestError is caused by something else, throw
  • We may retry/process_exception other known cases as they come up?
  • If there is an unknown exception... raise?

rlundeen2 avatar May 16 '24 14:05 rlundeen2