-
Notifications
You must be signed in to change notification settings - Fork 285
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
Conversation
{ | ||
label: "Annotations", | ||
type: "text", | ||
apply: "annotations['Hallucination'].label == 'hallucinated'", |
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.
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
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.
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'", |
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.
not sure if we are set on slowly migratin away from evals, if so this seems like a reasonable place to do it
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.
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.
if (!result?.isValid) { | ||
if (result?.errorMessage) { | ||
setErrorMessage(result.errorMessage); | ||
return; | ||
} |
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.
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} |
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.
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
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.
Oh good catch. Wish tab was auto-complete
@@ -396,6 +412,12 @@ function FilterConditionBuilder(props: { | |||
initialSnippet="cumulative_token_count.total > 1000" | |||
onAddFilterConditionSnippet={onAddFilterConditionSnippet} | |||
/> | |||
<FilterConditionSnippet |
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.
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'", |
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.
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'", |
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.
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} |
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.
Oh good catch. Wish tab was auto-complete
resolves #4000
resolves #4001
Adds simple annotation macro and snippet to SpanFilterConditionField
Screen.Recording.2024-07-25.at.10.15.15.PM.mov