Commit 45707b6
authored
feat: Add region property to ModelConfig (#201)
**Requirements**
- [x] I have added test coverage for new or changed functionality
- [x] I have followed the repository's [pull request submission
guidelines](../blob/main/CONTRIBUTING.md#submitting-pull-requests)
- [x] I have validated my changes against all supported platform
versions
**Related issues**
https://launchdarkly.atlassian.net/jira/software/c/projects/AIC/boards/2045?selectedIssue=AIC-2689
**Describe the solution you've provided**
Adds the `region` property to the `ModelConfig` object
**Additional context**
Some model providers, namely Bedrock, require including a `region` field
on a given call. A call for a sonnet model might look like:
`global.anthropic.sonnet-4-7` or `us.anthropic.sonnet-4-7` etc.
This field was added on the UI for Bedrock models and is optionally
includable. Users would be expected to prepend their region to their
model names if they're using a provider that requires it.
<!-- CURSOR_SUMMARY -->
---
> [!NOTE]
> **Low Risk**
> Backward-compatible optional field on model config parsing with no
changes to auth or provider call paths in this diff.
>
> **Overview**
> Adds optional **`region`** on **`ModelConfig`** so AI Config flag
variations can carry deployment region (e.g. Bedrock `us` vs `global`)
without encoding it only in the model name.
>
> **`LDAIClient`** now reads `model.region` from evaluated variations
when building completion/agent/judge configs, and **`to_dict()`**
includes **`region`** for round-tripping. Omitted **`region`** stays
**`None`**, so existing flags behave unchanged.
>
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
219f71b. Bugbot is set up for automated
code reviews on this repo. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->3 files changed
Lines changed: 67 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
832 | 832 | | |
833 | 833 | | |
834 | 834 | | |
| 835 | + | |
835 | 836 | | |
836 | 837 | | |
837 | 838 | | |
838 | | - | |
| 839 | + | |
| 840 | + | |
839 | 841 | | |
840 | 842 | | |
841 | 843 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
52 | 52 | | |
53 | 53 | | |
54 | 54 | | |
55 | | - | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
56 | 62 | | |
57 | 63 | | |
58 | 64 | | |
59 | 65 | | |
| 66 | + | |
60 | 67 | | |
61 | 68 | | |
62 | 69 | | |
63 | 70 | | |
| 71 | + | |
64 | 72 | | |
65 | 73 | | |
66 | 74 | | |
| |||
93 | 101 | | |
94 | 102 | | |
95 | 103 | | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
96 | 111 | | |
97 | 112 | | |
98 | 113 | | |
| |||
101 | 116 | | |
102 | 117 | | |
103 | 118 | | |
| 119 | + | |
104 | 120 | | |
105 | 121 | | |
106 | 122 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
34 | 51 | | |
35 | 52 | | |
36 | 53 | | |
| |||
482 | 499 | | |
483 | 500 | | |
484 | 501 | | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
| 518 | + | |
| 519 | + | |
| 520 | + | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
485 | 532 | | |
486 | 533 | | |
487 | 534 | | |
| |||
0 commit comments