File tree Expand file tree Collapse file tree 3 files changed +23
-14
lines changed
Expand file tree Collapse file tree 3 files changed +23
-14
lines changed Original file line number Diff line number Diff line change 1414from api .types .type_dataset import TypeDataset
1515from api .utils .enums import (
1616 PromptDomain ,
17- PromptFormat ,
1817 PromptTaskType ,
1918 TargetLanguage ,
2019 TargetModelType ,
2120)
2221
2322prompt_task_type_enum : EnumType = strawberry .enum (PromptTaskType ) # type: ignore
2423prompt_domain_enum : EnumType = strawberry .enum (PromptDomain ) # type: ignore
25- prompt_format_enum : EnumType = strawberry .enum (PromptFormat ) # type: ignore
2624target_language_enum : EnumType = strawberry .enum (TargetLanguage ) # type: ignore
2725target_model_type_enum : EnumType = strawberry .enum (TargetModelType ) # type: ignore
2826
@@ -57,14 +55,3 @@ class TypePromptMetadata:
5755 domain : Optional [prompt_domain_enum ]
5856 target_model_types : Optional [List [target_model_type_enum ]]
5957 evaluation_criteria : Optional [strawberry .scalars .JSON ]
60-
61-
62- @strawberry .type
63- class TypePromptResourceDetails :
64- """Prompt-specific fields for a resource/file."""
65-
66- prompt_format : Optional [prompt_format_enum ]
67- has_system_prompt : bool
68- has_example_responses : bool
69- avg_prompt_length : Optional [int ]
70- prompt_count : Optional [int ]
Original file line number Diff line number Diff line change 1+ """GraphQL type for prompt resource details."""
2+
3+ from typing import Optional
4+
5+ import strawberry
6+ from strawberry .enum import EnumType
7+
8+ from api .utils .enums import PromptFormat
9+
10+ # Create the enum for GraphQL schema
11+ prompt_format_enum : EnumType = strawberry .enum (PromptFormat ) # type: ignore
12+
13+
14+ @strawberry .type
15+ class TypePromptResourceDetails :
16+ """Prompt-specific fields for a resource/file."""
17+
18+ prompt_format : Optional [prompt_format_enum ]
19+ has_system_prompt : bool
20+ has_example_responses : bool
21+ avg_prompt_length : Optional [int ]
22+ prompt_count : Optional [int ]
Original file line number Diff line number Diff line change 1818from api .types .base_type import BaseType
1919from api .types .type_file_details import TypeFileDetails
2020from api .types .type_preview_data import PreviewData
21- from api .types .type_prompt_metadata import TypePromptResourceDetails
21+ from api .types .type_prompt_resource_details import TypePromptResourceDetails
2222from api .types .type_resource_metadata import TypeResourceMetadata
2323from api .utils .data_indexing import get_preview_data , get_row_count
2424from api .utils .graphql_telemetry import trace_resolver
You can’t perform that action at this time.
0 commit comments