Skip to content
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

feat(annotations): add annot ation macro and filter condition snippet to project page #4024

Merged
merged 3 commits into from
Jul 26, 2024

Conversation

Parker-Stafford
Copy link
Contributor

@Parker-Stafford Parker-Stafford commented Jul 26, 2024

resolves #4000
resolves #4001

Adds simple annotation macro and snippet to SpanFilterConditionField

Screen.Recording.2024-07-25.at.10.15.15.PM.mov

@dosubot dosubot bot added the size:M This PR changes 30-99 lines, ignoring generated files. label Jul 26, 2024
{
label: "Annotations",
type: "text",
apply: "annotations['Hallucination'].label == 'hallucinated'",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tried for a long time (probably too long) to get a macro with that would follow:
"annotations['${1}'].label == '${2}'"

and start the cursor at ${1} and go to ${2} on tab with no luck so just copied eval

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

damn, I think it's worth investing here a bit. We also have some short-term fixes we can try

@@ -168,7 +174,13 @@ function filterConditionCompletions(context: CompletionContext) {
{
label: "Hallucinations",
type: "text",
apply: "evals['Hallucination'].label == 'hallucinated'",
apply: "annotations['Hallucination'].label == 'hallucinated'",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not sure if we are set on slowly migratin away from evals, if so this seems like a reasonable place to do it

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

makes sense - I'm still not fully sure how we reconcile the wording - as in there is feedback and then there is annotations and evals under that. Hard to tell. This macro might ultimately be confusing. We might have to invest in the typehadead a bit more to make the filter bar really sing.

Comment on lines 286 to 290
if (!result?.isValid) {
if (result?.errorMessage) {
setErrorMessage(result.errorMessage);
return;
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmm might be able to remove this can test, had something where filter was invalid but no error message which was causing issues, will test again to see

@@ -298,6 +313,7 @@ export function SpanFilterConditionField(props: SpanFilterConditionFieldProps) {
</AddonBefore>
<CodeMirror
css={codeMirrorCSS}
indentWithTab={false}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

was from other testing but i don't think we want this anyways, tab now moves to next focusable element on page, as opposed to tab the query over

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh good catch. Wish tab was auto-complete

@@ -396,6 +412,12 @@ function FilterConditionBuilder(props: {
initialSnippet="cumulative_token_count.total > 1000"
onAddFilterConditionSnippet={onAddFilterConditionSnippet}
/>
<FilterConditionSnippet
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can remove eval snippets if we want as well

@@ -168,7 +174,13 @@ function filterConditionCompletions(context: CompletionContext) {
{
label: "Hallucinations",
type: "text",
apply: "evals['Hallucination'].label == 'hallucinated'",
apply: "annotations['Hallucination'].label == 'hallucinated'",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

makes sense - I'm still not fully sure how we reconcile the wording - as in there is feedback and then there is annotations and evals under that. Hard to tell. This macro might ultimately be confusing. We might have to invest in the typehadead a bit more to make the filter bar really sing.

{
label: "Annotations",
type: "text",
apply: "annotations['Hallucination'].label == 'hallucinated'",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

damn, I think it's worth investing here a bit. We also have some short-term fixes we can try

@@ -298,6 +313,7 @@ export function SpanFilterConditionField(props: SpanFilterConditionFieldProps) {
</AddonBefore>
<CodeMirror
css={codeMirrorCSS}
indentWithTab={false}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh good catch. Wish tab was auto-complete

@Parker-Stafford Parker-Stafford merged commit acc2ff1 into main Jul 26, 2024
6 checks passed
@Parker-Stafford Parker-Stafford deleted the parker/4000-annotations-dsl-filter branch July 26, 2024 17:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size:M This PR changes 30-99 lines, ignoring generated files.
Projects
None yet
2 participants