Add AzureOpenAI as a model provider to DraftValidation#387
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
pointblank/draft.py: newazure-openaibranch in__post_init__after the bedrock block, mirroring the_utils_ai.pypattern but usingself.api_keyand the draft-specific system prompt. Docstring updated in three places: class summary, model parameter description, and the "Constructing the model Argument" block (now lists five providers and explains the :deployment_id convention plus required env vars).pointblank/draft.py:254: fixed an unrelated latent Windows bug where api-docs.txt was being read with the platform default encoding (cp1252 on Windows), which crashed on non-latin1 bytes. Now uses encoding="utf-8". This only surfaced because the new tests reach further into__post_init__than the old ones.user_guide/02-advanced-validation/04-draft-validation.qmd: added Azure OpenAI to the supported-providers list, to the.envsample, and to the model-specification examples.tests/test_draft.py: two new tests covering the missing-endpoint and missing-api-version ValueError paths, following the existingmonkeypatch/importorskipstyle fromtest__utils_ai.py.Example Usage
Reproducible Test Code
Expected Output
Note
Make sure
OPENAI_API_VERSIONis set to2025-03-01-previewor later — the Azure OpenAI Responses API is only available on these versions.Related GitHub Issues and PRs
Fixes: #386
Checklist