_common.py 364 B

123456789101112131415161718192021
  1. from .._exceptions import OpenAIError
  2. INSTRUCTIONS = """
  3. OpenAI error:
  4. missing `{library}`
  5. This feature requires additional dependencies:
  6. $ pip install openai[{extra}]
  7. """
  8. def format_instructions(*, library: str, extra: str) -> str:
  9. return INSTRUCTIONS.format(library=library, extra=extra)
  10. class MissingDependencyError(OpenAIError):
  11. pass