-
Notifications
You must be signed in to change notification settings - Fork 143
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
AzureAI: Use Model Inference API (preview) for implementation of mode…
…l client (#807) * add azure-ai-inference to dev dependencies * remove self-signed workaround * initial work on azure inference api * remove unused * initial azureai tests * use tool calling fallback for llama on azureai * remove unused imports * playback tool calls to model * prevent azure logging * update changelog * increase context window; handle bad request errors * tag as content_filter --------- Co-authored-by: aisi-inspect <[email protected]>
- Loading branch information
1 parent
a02829b
commit 9dae6c5
Showing
10 changed files
with
303 additions
and
182 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
from copy import copy | ||
|
||
from pydantic import JsonValue | ||
|
||
from inspect_ai._util.constants import BASE_64_DATA_REMOVED | ||
|
||
|
||
def image_url_filter(key: JsonValue | None, value: JsonValue) -> JsonValue: | ||
# remove images from raw api call | ||
if key == "image_url" and isinstance(value, dict) and "url" in value: | ||
url = str(value.get("url")) | ||
if url.startswith("data:"): | ||
value = copy(value) | ||
value.update(url=BASE_64_DATA_REMOVED) | ||
return value |
Oops, something went wrong.