Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
157 changes: 138 additions & 19 deletions app/schema.graphql
Copy link
Contributor

Choose a reason for hiding this comment

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

The Annotation interface has more in it than it used to. Is that on purpose?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

These are all the shared fields among the child classes. I don’t think being comprehensive would cause any problems.

Original file line number Diff line number Diff line change
Expand Up @@ -38,24 +38,39 @@ interface Annotation {
"""Name of the annotation, e.g. 'helpfulness' or 'relevance'."""
name: String!

"""Value of the annotation in the form of a numeric score."""
score: Float
"""The kind of annotator that produced the annotation."""
annotatorKind: AnnotatorKind!

"""
Value of the annotation in the form of a string, e.g. 'helpful' or 'not helpful'. Note that the label is not necessarily binary.
"""
label: String

"""Value of the annotation in the form of a numeric score."""
score: Float

"""
The annotator's explanation for the annotation result (i.e. score or label, or both) given to the subject.
"""
explanation: String

"""The date and time when the annotation was created."""
"""Metadata about the annotation."""
metadata: JSON!

"""The source of the annotation."""
source: AnnotationSource!

"""The identifier of the annotation."""
identifier: String!

"""The date and time the annotation was created."""
createdAt: DateTime!

"""The date and time when the annotation was last updated."""
"""The date and time the annotation was last updated."""
updatedAt: DateTime!

"""The user that produced the annotation."""
user: User
}

union AnnotationConfig = CategoricalAnnotationConfig | ContinuousAnnotationConfig | FreeformAnnotationConfig
Expand Down Expand Up @@ -1037,31 +1052,45 @@ type DocumentAnnotation implements Node & Annotation {
"""Name of the annotation, e.g. 'helpfulness' or 'relevance'."""
name: String!

"""Value of the annotation in the form of a numeric score."""
score: Float
"""The kind of annotator that produced the annotation."""
annotatorKind: AnnotatorKind!

"""
Value of the annotation in the form of a string, e.g. 'helpful' or 'not helpful'. Note that the label is not necessarily binary.
"""
label: String

"""Value of the annotation in the form of a numeric score."""
score: Float

"""
The annotator's explanation for the annotation result (i.e. score or label, or both) given to the subject.
"""
explanation: String

"""The metadata associated with the annotation."""
metadata: JSON!

"""The source of the annotation."""
source: AnnotationSource!

"""The identifier of the annotation."""
identifier: String!

"""The date and time when the annotation was created."""
createdAt: DateTime!

"""The date and time when the annotation was last updated."""
updatedAt: DateTime!
annotatorKind: AnnotatorKind!
metadata: JSON!

"""The user that produced the annotation."""
user: User

"""The position of the annotation in the document."""
documentPosition: Int!
identifier: String!
source: AnnotationSource!

"""The span associated with the annotation."""
span: Span!
user: User
}

"""
Expand Down Expand Up @@ -1352,16 +1381,42 @@ type ExperimentRun implements Node {
type ExperimentRunAnnotation implements Node {
"""The Globally Unique ID of this object"""
id: ID!

"""Name of the annotation, e.g. 'helpfulness' or 'relevance'."""
name: String!

"""The kind of annotator that produced the annotation."""
annotatorKind: ExperimentRunAnnotatorKind!

"""
Value of the annotation in the form of a string, e.g. 'helpful' or 'not helpful'. Note that the label is not necessarily binary.
"""
label: String

"""Value of the annotation in the form of a numeric score."""
score: Float

"""
The annotator's explanation for the annotation result (i.e. score or label, or both) given to the subject.
"""
explanation: String

"""Error message if the annotation failed to produce a result."""
error: String

"""Metadata about the annotation."""
metadata: JSON!

"""The date and time when the annotation was created."""
startTime: DateTime!

"""The date and time when the annotation was last updated."""
endTime: DateTime!
traceId: String

"""The identifier of the trace associated with the annotation."""
traceId: ID

"""The trace associated with the annotation."""
trace: Trace
}

Expand Down Expand Up @@ -2088,15 +2143,42 @@ input ProjectSessionAnnoResultKey {
type ProjectSessionAnnotation implements Node {
"""The Globally Unique ID of this object"""
id: ID!

"""Name of the annotation, e.g. 'helpfulness' or 'relevance'."""
name: String!

"""The kind of annotator that produced the annotation."""
annotatorKind: AnnotatorKind!

"""
Value of the annotation in the form of a string, e.g. 'helpful' or 'not helpful'. Note that the label is not necessarily binary.
"""
label: String

"""Value of the annotation in the form of a numeric score."""
score: Float

"""
The annotator's explanation for the annotation result (i.e. score or label, or both) given to the subject.
"""
explanation: String

"""Metadata about the annotation."""
metadata: JSON!

"""The identifier of the annotation."""
identifier: String!

"""The source of the annotation."""
source: AnnotationSource!

"""The project session associated with the annotation."""
projectSessionId: ID!

"""The project session associated with the annotation."""
projectSession: ProjectSession!

"""The user that produced the annotation."""
user: User
}

Expand Down Expand Up @@ -2642,30 +2724,43 @@ type SpanAnnotation implements Node & Annotation {
"""Name of the annotation, e.g. 'helpfulness' or 'relevance'."""
name: String!

"""Value of the annotation in the form of a numeric score."""
score: Float
"""The kind of annotator that produced the annotation."""
annotatorKind: AnnotatorKind!

"""
Value of the annotation in the form of a string, e.g. 'helpful' or 'not helpful'. Note that the label is not necessarily binary.
"""
label: String

"""Value of the annotation in the form of a numeric score."""
score: Float

"""
The annotator's explanation for the annotation result (i.e. score or label, or both) given to the subject.
"""
explanation: String

"""Metadata about the annotation."""
metadata: JSON!

"""The source of the annotation."""
source: AnnotationSource!

"""The identifier of the annotation."""
identifier: String!

"""The date and time when the annotation was created."""
createdAt: DateTime!

"""The date and time when the annotation was last updated."""
updatedAt: DateTime!
annotatorKind: AnnotatorKind!
metadata: JSON!
source: AnnotationSource!
identifier: String!
spanId: ID!

"""The user that produced the annotation."""
user: User
spanId: ID!

"""The span associated with the annotation."""
span: Span!
}

enum SpanAnnotationColumn {
Expand Down Expand Up @@ -3011,15 +3106,39 @@ type Trace implements Node {
type TraceAnnotation implements Node {
"""The Globally Unique ID of this object"""
id: ID!

"""Name of the annotation, e.g. 'helpfulness' or 'relevance'."""
name: String!

"""The kind of annotator that produced the annotation."""
annotatorKind: AnnotatorKind!

"""
Value of the annotation in the form of a string, e.g. 'helpful' or 'not helpful'. Note that the label is not necessarily binary.
"""
label: String

"""Value of the annotation in the form of a numeric score."""
score: Float

"""
The annotator's explanation for the annotation result (i.e. score or label, or both) given to the subject.
"""
explanation: String

"""Metadata about the annotation."""
metadata: JSON!

"""The identifier of the annotation."""
identifier: String!

"""The source of the annotation."""
source: AnnotationSource!

"""The trace associated with the annotation."""
trace: Trace!

"""The user that produced the annotation."""
user: User
}

Expand Down
16 changes: 16 additions & 0 deletions src/phoenix/server/api/context.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,21 +103,28 @@ class DataLoaders:
dataset_example_revisions: DatasetExampleRevisionsDataLoader
dataset_example_spans: DatasetExampleSpansDataLoader
dataset_labels: DatasetLabelsDataLoader
dataset_label_fields: TableFieldsDataLoader
dataset_dataset_splits: DatasetDatasetSplitsDataLoader
dataset_examples_and_versions_by_experiment_run: (
DatasetExamplesAndVersionsByExperimentRunDataLoader
)
dataset_example_splits: DatasetExampleSplitsDataLoader
dataset_fields: TableFieldsDataLoader
dataset_split_fields: TableFieldsDataLoader
dataset_version_fields: TableFieldsDataLoader
document_annotation_fields: TableFieldsDataLoader
document_evaluation_summaries: DocumentEvaluationSummaryDataLoader
document_evaluations: DocumentEvaluationsDataLoader
document_retrieval_metrics: DocumentRetrievalMetricsDataLoader
experiment_annotation_summaries: ExperimentAnnotationSummaryDataLoader
experiment_dataset_splits: ExperimentDatasetSplitsDataLoader
experiment_error_rates: ExperimentErrorRatesDataLoader
experiment_fields: TableFieldsDataLoader
experiment_repeated_run_group_annotation_summaries: (
ExperimentRepeatedRunGroupAnnotationSummariesDataLoader
)
experiment_repeated_run_groups: ExperimentRepeatedRunGroupsDataLoader
experiment_run_annotation_fields: TableFieldsDataLoader
experiment_run_annotations: ExperimentRunAnnotations
experiment_run_counts: ExperimentRunCountsDataLoader
experiment_sequence_number: ExperimentSequenceNumberDataLoader
Expand All @@ -130,7 +137,12 @@ class DataLoaders:
project_fields: TableFieldsDataLoader
project_trace_retention_policy_fields: TableFieldsDataLoader
projects_by_trace_retention_policy_id: ProjectIdsByTraceRetentionPolicyIdDataLoader
prompt_fields: TableFieldsDataLoader
prompt_label_fields: TableFieldsDataLoader
prompt_version_sequence_number: PromptVersionSequenceNumberDataLoader
prompt_version_tag_fields: TableFieldsDataLoader
project_session_annotation_fields: TableFieldsDataLoader
project_session_fields: TableFieldsDataLoader
record_counts: RecordCountDataLoader
session_annotations_by_session: SessionAnnotationsBySessionDataLoader
session_first_inputs: SessionIODataLoader
Expand All @@ -139,6 +151,7 @@ class DataLoaders:
session_num_traces_with_error: SessionNumTracesWithErrorDataLoader
session_token_usages: SessionTokenUsagesDataLoader
session_trace_latency_ms_quantile: SessionTraceLatencyMsQuantileDataLoader
span_annotation_fields: TableFieldsDataLoader
span_annotations: SpanAnnotationsDataLoader
span_by_id: SpanByIdDataLoader
span_cost_by_span: SpanCostBySpanDataLoader
Expand Down Expand Up @@ -167,12 +180,15 @@ class DataLoaders:
span_fields: TableFieldsDataLoader
span_projects: SpanProjectsDataLoader
token_counts: TokenCountDataLoader
trace_annotation_fields: TableFieldsDataLoader
trace_annotations_by_trace: TraceAnnotationsByTraceDataLoader
trace_by_trace_ids: TraceByTraceIdsDataLoader
trace_fields: TableFieldsDataLoader
trace_retention_policy_id_by_project_id: TraceRetentionPolicyIdByProjectIdDataLoader
trace_root_spans: TraceRootSpansDataLoader
user_roles: UserRolesDataLoader
user_api_key_fields: TableFieldsDataLoader
user_fields: TableFieldsDataLoader
users: UsersDataLoader


Expand Down
Loading
Loading