-
Notifications
You must be signed in to change notification settings - Fork 438
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
FEAT: Adding AzureChatCompletionsTarget #687
base: main
Are you sure you want to change the base?
Conversation
# %% [markdown] | ||
# # Azure Chat Completions Target | ||
# | ||
# This will allow you to easily interact with models in [Azure AI Foundry](https://ai.azure.com/), such as DeepSeek R1, Phi-4, Mistral, and LLAMA. |
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.
Can we explain why and how this is different from Azure ML Chat Target and Azure Open AI? I honestly don't fully know either.
session.add_all(entries) | ||
for entry in entries: | ||
session.merge(entry) |
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.
Behavior is the same, right? How does it help?
@@ -130,7 +130,7 @@ def to_dict(self): | |||
} | |||
|
|||
def __str__(self): | |||
if self.scorer_class_identifier: | |||
if self.scorer_class_identifier and self.scorer_class_identifier.get("__type__"): |
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.
if self.scorer_class_identifier and self.scorer_class_identifier.get("__type__"): | |
if self.scorer_class_identifier and "__type__" in self.scorer_class_identifier: |
nit
logger = logging.getLogger(__name__) | ||
|
||
|
||
class AzureChatCompletionsTarget(PromptChatTarget): |
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.
This class needs a docstring. I would love to have the difference between this, AOAI, and AML explained as well. Maybe that should be explained on all of these three 😆
finish_reason = azure_completion.choices[0].finish_reason | ||
|
||
# finish_reason should be stop if things were a success | ||
if finish_reason != "stop": |
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.
isn't there a finish reason like token limit? So it's kind of a partial success?
|
||
if scores: | ||
# need to insert the prompt first since it has a primary key constraint | ||
# this will be re-inserted by prompt_normalizer, but that's okay |
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.
as in, there won't be duplicates, right?
This target supports Azure Foundry deployed models, including Phi-4, DeepSeek-R1, Ministral, Llama 3.1, and more.
Memory updates