feat(prompt): --environment flag - #330
Conversation
|
Latest downloadable build artifacts for this PR commit
Available artifact names
|
7d5482d to
dae65e7
Compare
a65b244 to
5399912
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1a1b66369d
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "Codex (@codex) review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "Codex (@codex) address that feedback".
| project_id: &str, | ||
| prompt_id: &str, | ||
| ) -> Result<Vec<String>> { | ||
| let body = prompt_versions_request(project_id, prompt_id); |
There was a problem hiding this comment.
are we properly paginating here?
There was a problem hiding this comment.
No.
(lines numbers from the branch cedric/endpoint-check-reject-unknown-slug for braintrust)
Audit logs don't support pagination:
braintrust/api-ts/src/btql.ts:1610:
if (body.audit_log) {
// Audit log queries do not support pagination.
boundQuery.limit = undefined;
boundFilter.limit = undefined;
}
And cursors are not supported braintrust/api-ts/src/btql.ts:1971:
if (!useBrainstore && body.audit_log) {
adjustBoundQueryForAuditLog({
boundQuery: boundFilter,
objectType: objectType,
testingOnlyAllowQueryFullAuditLog:
body._testing_only_allow_query_full_audit_log,
});
if (cursorParams) {
throw new BadRequestError("Audit log queries do not support cursors");
}
}
Btw the python SDK doesn't paginate either when querying audit logs braintrust-sdk-python/py/src/braintrust/logger.py:6146:
resp = _state.api_conn().post(
"btql",
json={
"query": query,
"audit_log": True,
"use_columnstore": False,
"brainstore_realtime": True,
},
headers={"Accept-Encoding": "gzip"},
)
.... all according to the slop
There was a problem hiding this comment.
I don't think this code branch is related to audit logs in any way right? I was more asking about pagination for prompts list. Why are audit logs relevant?
control which environment is shown or assigned to the prompts
4bb697c to
0d4b76a
Compare
Adds
bt prompts ...:versionssubcommand(un)assignsubcommands--environmentflag forlist/view/assign/unassignandbt functions view--versionflag forviewUsage in the examples bellow.
Prompt version ids have a long form (19 characters) and a short form (16 characters), both are valid when requested.
In case you were unaware of the existence of environments like me, they are in https://www.braintrust.dev/app/your-org/p/your-project/configuration/org/environments
Examples:
Details
https://linear.app/braintrustdata/issue/SDK-244/environment-tags-in-the-bt-cli
See also the backend PR, and the environment management pr.