[AIC-3484] Send LD-API-Version on evaluations API requests - #116
Merged
Merged
Conversation
…quests Pins 20240415 so evaluations calls made with a customer's token are not rejected when that token defaults below API v4. Co-authored-by: Cursor <cursoragent@cursor.com>
bwoskow-ld
approved these changes
Sep 28, 2026
bwoskow-ld
left a comment
Member
There was a problem hiding this comment.
LGTM but with an optional stylistic comment.
Contributor
Author
|
It was following the precedence on the the similar _DEFAULT_BASE_URI but if
that's the only spot the header is needed, then we can add it there.
…On Mon, Sep 28, 2026 at 12:06 PM Ben Woskow ***@***.***> wrote:
***@***.**** approved this pull request.
LGTM but with an optional stylistic comment.
------------------------------
In packages/client/src/launchdarkly_ai_server/evaluations/api.py
<#116 (comment)>
:
> @@ -137,6 +138,7 @@ def request(
headers = {
"Authorization": self.api_token,
"Accept": "application/json",
+ "LD-API-Version": _LD_API_VERSION,
Why not just inline "20240415" here given that it's only used once? My
personal preference is to have it here because it's easier to find/manage
if it's co-located with the context of how it'll be used in this
configuration.
—
Reply to this email directly, view it on GitHub
<#116?email_source=notifications&email_token=AABUP6DVQEN2XQXEMINGJML5RKZDHA5CNFSNUABKM5UWIORPF5TWS5BNNB2WEL2QOVWGYUTFOF2WK43UKJSXM2LFO4XTKMZUGMZTQMZTGQ32M4TFMFZW63VGMF2XI2DPOKSWK5TFNZ2KYZTPN52GK4S7MNWGSY3L#pullrequestreview-5343383347>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AABUP6C27774C5GWOSZHXGD5RKZDHAVCNFSNUABGKJSXA33TNF2G64TZHMYTGMJYG4YTEMJSGA5US43TOVSTWNJWGE4TMOBQGAYTBILWAI>
.
You are receiving this because you authored the thread.Message ID:
<launchdarkly/python-ai-sdk/pull/116/review/5343383347 <(534)%20338-3347>@
github.com>
|
Matches the optimizer client in python-server-sdk-ai#216 and addresses review feedback: the value is used once, so keep it next to the header. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
LD-API-Version: 20240415on every LaunchDarkly management API request.Test plan
uv run pytest packages/client/tests/test_evaluations.py packages/client/tests/test_evaluations_run.pyLD-API-Version: 20240415.