-
Notifications
You must be signed in to change notification settings - Fork 89
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding support for Azure AI Foundary (#1469)
<!-- ELLIPSIS_HIDDEN --> > [!IMPORTANT] > Adds support for Azure AI Foundary by introducing new client functionality, updating documentation, and adding integration tests. > > - **Behavior**: > - Adds `ensure_query_params()` in `helpers.rs` to handle query parameters for Azure AI Foundary. > - Modifies `UnresolvedOpenAI` in `openai.rs` to use `ensure_query_params()` for query parameter handling. > - Removes commented-out code related to completion streams in `openai_client.rs`. > - **Documentation**: > - Adds `azure-ai-foundary.mdx` for Azure AI Foundary usage instructions. > - Updates `docs.yml` to include Azure AI Foundary documentation. > - **Testing**: > - Adds `deepseek-azure.baml` for integration testing of Azure AI Foundary. > - Updates `gen-baml-client.py` to include React in the list of targets. > - Modifies `openapi.yaml` to include `TellStory` operation for Azure AI Foundary. > - Updates various client files in `python`, `react`, `ruby`, and `typescript` to support `TellStory` function. > > <sup>This description was created by </sup>[<img alt="Ellipsis" src="https://img.shields.io/badge/Ellipsis-blue?color=175173">](https://www.ellipsis.dev?ref=BoundaryML%2Fbaml&utm_source=github&utm_medium=referral)<sup> for aff70a2. It will automatically update as commits are pushed.</sup> <!-- ELLIPSIS_HIDDEN -->
- Loading branch information
Showing
25 changed files
with
586 additions
and
104 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
20 changes: 20 additions & 0 deletions
20
fern/03-reference/baml/clients/providers/azure-ai-foundary.mdx
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,20 @@ | ||
--- | ||
title: Azure AI Foundary | ||
--- | ||
|
||
To use the Azure AI Foundary ([https://ai.azure.com](https://ai.azure.com)), you can leverage the [`openai-generic`](/docs/snippets/clients/providers/openai) provider. | ||
|
||
**Example:** | ||
|
||
```baml BAML | ||
client<llm> MyClient { | ||
provider "openai-generic" | ||
options { | ||
base_url "https://RESOURCE_NAME.REGION.models.ai.azure.com" | ||
api_key env.MY_API_KEY | ||
} | ||
} | ||
``` | ||
|
||
See here to see how to get your API key and base url: | ||
<img src="/assets/languages/azure-ai-foundary.png" alt="Azure AI Foundary" /> |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
25 changes: 25 additions & 0 deletions
25
integ-tests/baml_src/test-files/models/deepseek-azure.baml
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,25 @@ | ||
client<llm> DeepSeekAzure { | ||
provider openai-generic | ||
options { | ||
base_url "https://DeepSeek-R1-dtjbj.eastus2.models.ai.azure.com" | ||
api_key env.DEEPSEEK_AZURE_API_KEY | ||
max_tokens 10 | ||
} | ||
} | ||
|
||
function TellStory(story: string) -> string { | ||
client DeepSeekAzure | ||
prompt #" | ||
You are a storyteller. Tell a story about the following: | ||
{{ _.role("user") }} {{ story }} | ||
"# | ||
} | ||
|
||
test TellStory { | ||
functions [TellStory] | ||
args { | ||
story #" | ||
Once upon a time, there was a cat who loved to play with yarn. | ||
"# | ||
} | ||
} |
Oops, something went wrong.