-
Notifications
You must be signed in to change notification settings - Fork 1.6k
[issue-7462] [SDK] fix: use direct workspace-scoped URL for experiment link in evaluate() #7589
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,5 @@ | ||
| import base64 | ||
| import json | ||
| import urllib.parse | ||
| from typing import Final | ||
|
|
||
|
|
@@ -28,15 +29,11 @@ def get_ui_url() -> str: | |
|
|
||
|
|
||
| def get_experiment_url_by_id( | ||
| dataset_id: str, experiment_id: str, url_override: str | ||
| dataset_id: str, experiment_id: str, base_url: str, workspace: str | ||
| ) -> str: | ||
| encoded_opik_url = base64.b64encode(url_override.encode("utf-8")).decode("utf-8") | ||
|
|
||
| project_path = urllib.parse.quote( | ||
| f"v1/session/redirect/experiments/?experiment_id={experiment_id}&dataset_id={dataset_id}&path={encoded_opik_url}", | ||
| safe=ALLOWED_URL_CHARACTERS, | ||
| ) | ||
| return urllib.parse.urljoin(ensure_ending_slash(url_override), project_path) | ||
| domain_root = get_base_url(base_url) | ||
| experiments_param = urllib.parse.quote(json.dumps([experiment_id])) | ||
| return f"{domain_root}opik/{workspace}/experiments/{dataset_id}/compare?experiments={experiments_param}" | ||
|
Comment on lines
31
to
+36
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Undocumented public URL contract
Want Baz to fix this for you? Activate Fixer Other fix methodsPrompt for AI Agents |
||
|
|
||
|
|
||
| def get_project_url_by_workspace( | ||
|
|
||
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.
Placeholder workspace builds wrong URLs
_evaluate_task()and the other evaluator link sites passworkspace=client._workspaceintourl_helpers.get_experiment_url_by_id(), so whenOpikConfig.workspaceis the"default"placeholder the compare link points at/opik/default/...instead of the resolved workspace — should we route this throughOpik._dereferenced_workspace()first?Want Baz to fix this for you? Activate Fixer
Other fix methods
Prompt for AI Agents