-
Notifications
You must be signed in to change notification settings - Fork 163
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add AzureOpenAiStructureConfig
, default azure_deployment
#788
Conversation
0998f4b
to
9e2a7b5
Compare
b664e94
to
fc427c7
Compare
6a96e24
to
649bfc2
Compare
649bfc2
to
e2f7f72
Compare
3683e70
to
592075e
Compare
AzureOpenAiStructureConfig
AzureOpenAiStructureConfig
, default azure_deployment
af6f90f
to
2814c04
Compare
# pull_request_review: | ||
# types: [submitted] | ||
pull_request: | ||
branches: | ||
- dev | ||
jobs: | ||
test: | ||
if: github.event.review.state == 'APPROVED' | ||
# if: github.event.review.state == 'APPROVED' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice hack to get tests running haha. Just need to revert.
2814c04
to
0139e14
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also pls update changelog.
kw_only=True, default=None, metadata={"serializable": False} | ||
) | ||
api_key: str = field(kw_only=True, default=None, metadata={"serializable": False}) | ||
prompt_driver: AzureOpenAiChatPromptDriver = field( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All of the Driver type hints should use the base class so that they can be overridden with non-azure drivers.
azure_ad_token_provider: Optional[Callable[[], str]] = field( | ||
kw_only=True, default=None, metadata={"serializable": False} | ||
) | ||
api_key: str = field(kw_only=True, default=None, metadata={"serializable": False}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing Optional
type hint.
azure_ad_token_provider: Optional[Callable[[], str]] = field( | ||
kw_only=True, default=None, metadata={"serializable": False} | ||
) | ||
api_key: str = field(kw_only=True, default=None, metadata={"serializable": False}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't have this field anywhere else, wondering if we should add to the base class?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
probably makes sense actually, i dont really see the benefit. the base class wouldn't do anything with the api_key field by default; at best it reduces some code, at worst it obfuscates where that field is getting pulled from. also some config classes don't use api_key
at all (aws bedrock drivers/config)
prompt_driver: AzureOpenAiChatPromptDriver = field( | ||
default=Factory( | ||
lambda self: AzureOpenAiChatPromptDriver( | ||
model="gpt-4o", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this out of preview yet? If not we should probably use gpt-4-turbo
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
would have to be just gpt-4
, gpt-4-turbo
is a "version" of gpt-4
as far as azure openai is concerned.
vector_store_driver: A Local Vector Store Driver. | ||
""" | ||
|
||
azure_endpoint: str = field(kw_only=True, metadata={"serializable": True}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing azure_deployment
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the deployments now default to the model
. it doesn't make sense on the top-level of the config because the deployments are per model.
config=deserialized_config.merge_config({ | ||
"prompt_driver" : { | ||
"model": "anthropic.claude-3-sonnet-20240229-v1:0", | ||
}, | ||
}), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would be a good place to show off how azure_deployment
can be merged in.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated on the azure openai example
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work. Let's merge after #794 to make sure we're not missing anything.
a0f1dec
to
532dec9
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅ 📢 Thoughts on this report? Let us know! |
closes #790
AzureOpenAiStructureConfig
azure_deployment
to the modelAzureOpenAiVisionImageQueryDriver
serializable=False
forazure_ad_token