Skip to content

Initial prototype v1 openai support for azure#7

Draft
johanste wants to merge 10 commits into
v1from
v1_azure
Draft

Initial prototype v1 openai support for azure#7
johanste wants to merge 10 commits into
v1from
v1_azure

Conversation

@johanste
Copy link
Copy Markdown
Owner

@johanste johanste commented Oct 3, 2023

Hacked in support for azure. Have only tried the chat completion endpoint.

Limitations:

  • One client per deployment (e.g. no way to pass in deployment on a per-invocation) NOTE: currently accepting deployment_id as model on per-method basis to address this limitation
  • Typing busted for constructor (because of the use of *args, **kwargs) - can be fixed by copying the signature from the base (or possibly using a functools.wraps like decorator that copies the signature)
  • No typing support for azure specific additions

Additional work:

  • Audio/whisper does not work for openai or azure currently. Both services expect the filename provided in the second case, but the v1 API doesn't have a parameter for that
    • send io.BufferedReader: RuntimeError: Expected entry at file to be bytes or a tuple but received <class '_io.BufferedReader'> instead.
    • send bytes: openai.BadRequestError: Error code: 400 - {'error': {'message': "Unrecognized file format. Supported formats: ['flac', 'm4a', 'mp3', 'mp4', 'mpeg', 'mpga', 'oga', 'ogg', 'wav', 'webm']", 'type': 'invalid_request_error', 'param': None, 'code': None}} files = [('file', ('hello.m4a', files[0][1], 'application/octet-stream'))]
  • Lacks good exception support, especially for prompts caught by the content filter (WIP consider a custom exception for rai #14)
  • No Module client support
  • No CLI support
  • Some response types still need wrapping to expose Azure-specific properties
    • Model
    • ??
  • No testing for fine-tuning/fine-tunes/files yet
  • Typing improvements, where possible. Needs a thorough type checking/linting/blackening of the code.
  • Need blessings for where we're touching internal APIs, where we're conflating deployment_id with model
  • General clean-up of code, address TODOs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants