scale-gp-beta 0.1.0a2__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (78) hide show
  1. scale_gp/__init__.py +96 -0
  2. scale_gp/_base_client.py +2058 -0
  3. scale_gp/_client.py +544 -0
  4. scale_gp/_compat.py +219 -0
  5. scale_gp/_constants.py +14 -0
  6. scale_gp/_exceptions.py +108 -0
  7. scale_gp/_files.py +123 -0
  8. scale_gp/_models.py +801 -0
  9. scale_gp/_qs.py +150 -0
  10. scale_gp/_resource.py +43 -0
  11. scale_gp/_response.py +830 -0
  12. scale_gp/_streaming.py +333 -0
  13. scale_gp/_types.py +217 -0
  14. scale_gp/_utils/__init__.py +57 -0
  15. scale_gp/_utils/_logs.py +25 -0
  16. scale_gp/_utils/_proxy.py +62 -0
  17. scale_gp/_utils/_reflection.py +42 -0
  18. scale_gp/_utils/_streams.py +12 -0
  19. scale_gp/_utils/_sync.py +86 -0
  20. scale_gp/_utils/_transform.py +402 -0
  21. scale_gp/_utils/_typing.py +149 -0
  22. scale_gp/_utils/_utils.py +414 -0
  23. scale_gp/_version.py +4 -0
  24. scale_gp/lib/.keep +4 -0
  25. scale_gp/pagination.py +83 -0
  26. scale_gp/py.typed +0 -0
  27. scale_gp/resources/__init__.py +103 -0
  28. scale_gp/resources/chat/__init__.py +33 -0
  29. scale_gp/resources/chat/chat.py +102 -0
  30. scale_gp/resources/chat/completions.py +1054 -0
  31. scale_gp/resources/completions.py +765 -0
  32. scale_gp/resources/files/__init__.py +33 -0
  33. scale_gp/resources/files/content.py +162 -0
  34. scale_gp/resources/files/files.py +558 -0
  35. scale_gp/resources/inference.py +210 -0
  36. scale_gp/resources/models.py +834 -0
  37. scale_gp/resources/question_sets.py +680 -0
  38. scale_gp/resources/questions.py +396 -0
  39. scale_gp/types/__init__.py +33 -0
  40. scale_gp/types/chat/__init__.py +8 -0
  41. scale_gp/types/chat/chat_completion.py +257 -0
  42. scale_gp/types/chat/chat_completion_chunk.py +240 -0
  43. scale_gp/types/chat/completion_create_params.py +156 -0
  44. scale_gp/types/chat/completion_create_response.py +11 -0
  45. scale_gp/types/completion.py +116 -0
  46. scale_gp/types/completion_create_params.py +108 -0
  47. scale_gp/types/file.py +30 -0
  48. scale_gp/types/file_create_params.py +13 -0
  49. scale_gp/types/file_delete_response.py +16 -0
  50. scale_gp/types/file_list.py +27 -0
  51. scale_gp/types/file_list_params.py +16 -0
  52. scale_gp/types/file_update_params.py +12 -0
  53. scale_gp/types/files/__init__.py +3 -0
  54. scale_gp/types/inference_create_params.py +25 -0
  55. scale_gp/types/inference_create_response.py +11 -0
  56. scale_gp/types/inference_model.py +167 -0
  57. scale_gp/types/inference_model_list.py +27 -0
  58. scale_gp/types/inference_response.py +14 -0
  59. scale_gp/types/inference_response_chunk.py +14 -0
  60. scale_gp/types/model_create_params.py +165 -0
  61. scale_gp/types/model_delete_response.py +16 -0
  62. scale_gp/types/model_list_params.py +20 -0
  63. scale_gp/types/model_update_params.py +161 -0
  64. scale_gp/types/question.py +68 -0
  65. scale_gp/types/question_create_params.py +59 -0
  66. scale_gp/types/question_list.py +27 -0
  67. scale_gp/types/question_list_params.py +16 -0
  68. scale_gp/types/question_set.py +106 -0
  69. scale_gp/types/question_set_create_params.py +115 -0
  70. scale_gp/types/question_set_delete_response.py +16 -0
  71. scale_gp/types/question_set_list.py +27 -0
  72. scale_gp/types/question_set_list_params.py +20 -0
  73. scale_gp/types/question_set_retrieve_params.py +12 -0
  74. scale_gp/types/question_set_update_params.py +23 -0
  75. scale_gp_beta-0.1.0a2.dist-info/METADATA +440 -0
  76. scale_gp_beta-0.1.0a2.dist-info/RECORD +78 -0
  77. scale_gp_beta-0.1.0a2.dist-info/WHEEL +4 -0
  78. scale_gp_beta-0.1.0a2.dist-info/licenses/LICENSE +201 -0
@@ -0,0 +1,68 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from typing import Dict, List, Union, Optional
4
+ from datetime import datetime
5
+ from typing_extensions import Literal
6
+
7
+ from pydantic import Field as FieldInfo
8
+
9
+ from .._models import BaseModel
10
+
11
+ __all__ = ["Question", "Choice", "NumberOptions", "RatingOptions"]
12
+
13
+
14
+ class Choice(BaseModel):
15
+ label: str
16
+
17
+ value: Union[str, bool, float]
18
+
19
+ audit_required: Optional[bool] = None
20
+
21
+
22
+ class NumberOptions(BaseModel):
23
+ max: Optional[float] = None
24
+ """Maximum value for the number"""
25
+
26
+ min: Optional[float] = None
27
+ """Minimum value for the number"""
28
+
29
+
30
+ class RatingOptions(BaseModel):
31
+ max_label: str = FieldInfo(alias="maxLabel")
32
+ """Maximum value for the rating"""
33
+
34
+ min_label: str = FieldInfo(alias="minLabel")
35
+ """Minimum value for the rating"""
36
+
37
+ scale_steps: int = FieldInfo(alias="scaleSteps")
38
+ """Number of steps in the rating scale"""
39
+
40
+
41
+ class Question(BaseModel):
42
+ id: str
43
+
44
+ created_at: datetime
45
+
46
+ created_by_user_id: str
47
+
48
+ prompt: str
49
+
50
+ title: str
51
+
52
+ type: Literal["categorical", "free_text", "rating", "number"]
53
+
54
+ choices: Optional[List[Choice]] = None
55
+
56
+ conditions: Optional[List[Dict[str, object]]] = None
57
+
58
+ dropdown: Optional[bool] = None
59
+
60
+ multi: Optional[bool] = None
61
+
62
+ number_options: Optional[NumberOptions] = FieldInfo(alias="numberOptions", default=None)
63
+
64
+ object: Optional[Literal["question"]] = None
65
+
66
+ rating_options: Optional[RatingOptions] = FieldInfo(alias="ratingOptions", default=None)
67
+
68
+ required: Optional[bool] = None
@@ -0,0 +1,59 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from __future__ import annotations
4
+
5
+ from typing import Dict, Union, Iterable
6
+ from typing_extensions import Literal, Required, Annotated, TypedDict
7
+
8
+ from .._utils import PropertyInfo
9
+
10
+ __all__ = ["QuestionCreateParams", "Choice", "NumberOptions", "RatingOptions"]
11
+
12
+
13
+ class QuestionCreateParams(TypedDict, total=False):
14
+ prompt: Required[str]
15
+
16
+ title: Required[str]
17
+
18
+ type: Required[Literal["categorical", "free_text", "rating", "number"]]
19
+
20
+ choices: Iterable[Choice]
21
+
22
+ conditions: Iterable[Dict[str, object]]
23
+
24
+ dropdown: bool
25
+
26
+ multi: bool
27
+
28
+ number_options: Annotated[NumberOptions, PropertyInfo(alias="numberOptions")]
29
+
30
+ rating_options: Annotated[RatingOptions, PropertyInfo(alias="ratingOptions")]
31
+
32
+ required: bool
33
+
34
+
35
+ class Choice(TypedDict, total=False):
36
+ label: Required[str]
37
+
38
+ value: Required[Union[str, bool, float]]
39
+
40
+ audit_required: bool
41
+
42
+
43
+ class NumberOptions(TypedDict, total=False):
44
+ max: float
45
+ """Maximum value for the number"""
46
+
47
+ min: float
48
+ """Minimum value for the number"""
49
+
50
+
51
+ class RatingOptions(TypedDict, total=False):
52
+ max_label: Required[Annotated[str, PropertyInfo(alias="maxLabel")]]
53
+ """Maximum value for the rating"""
54
+
55
+ min_label: Required[Annotated[str, PropertyInfo(alias="minLabel")]]
56
+ """Minimum value for the rating"""
57
+
58
+ scale_steps: Required[Annotated[int, PropertyInfo(alias="scaleSteps")]]
59
+ """Number of steps in the rating scale"""
@@ -0,0 +1,27 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from typing import List, Optional
4
+ from typing_extensions import Literal
5
+
6
+ from .._models import BaseModel
7
+ from .question import Question
8
+
9
+ __all__ = ["QuestionList"]
10
+
11
+
12
+ class QuestionList(BaseModel):
13
+ has_more: bool
14
+ """Whether there are more items left to be fetched."""
15
+
16
+ items: List[Question]
17
+
18
+ total: int
19
+ """The total of items that match the query.
20
+
21
+ This is greater than or equal to the number of items returned.
22
+ """
23
+
24
+ limit: Optional[int] = None
25
+ """The maximum number of items to return."""
26
+
27
+ object: Optional[Literal["list"]] = None
@@ -0,0 +1,16 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from __future__ import annotations
4
+
5
+ from typing import Optional
6
+ from typing_extensions import TypedDict
7
+
8
+ __all__ = ["QuestionListParams"]
9
+
10
+
11
+ class QuestionListParams(TypedDict, total=False):
12
+ ending_before: Optional[str]
13
+
14
+ limit: int
15
+
16
+ starting_after: Optional[str]
@@ -0,0 +1,106 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from typing import Dict, List, Union, Optional
4
+ from datetime import datetime
5
+ from typing_extensions import Literal
6
+
7
+ from pydantic import Field as FieldInfo
8
+
9
+ from .._models import BaseModel
10
+
11
+ __all__ = [
12
+ "QuestionSet",
13
+ "Question",
14
+ "QuestionChoice",
15
+ "QuestionNumberOptions",
16
+ "QuestionOverrideConfig",
17
+ "QuestionRatingOptions",
18
+ ]
19
+
20
+
21
+ class QuestionChoice(BaseModel):
22
+ label: str
23
+
24
+ value: Union[str, bool, float]
25
+
26
+ audit_required: Optional[bool] = None
27
+
28
+
29
+ class QuestionNumberOptions(BaseModel):
30
+ max: Optional[float] = None
31
+ """Maximum value for the number"""
32
+
33
+ min: Optional[float] = None
34
+ """Minimum value for the number"""
35
+
36
+
37
+ class QuestionOverrideConfig(BaseModel):
38
+ required: Optional[bool] = None
39
+ """Whether the question is required. False by default."""
40
+
41
+
42
+ class QuestionRatingOptions(BaseModel):
43
+ max_label: str = FieldInfo(alias="maxLabel")
44
+ """Maximum value for the rating"""
45
+
46
+ min_label: str = FieldInfo(alias="minLabel")
47
+ """Minimum value for the rating"""
48
+
49
+ scale_steps: int = FieldInfo(alias="scaleSteps")
50
+ """Number of steps in the rating scale"""
51
+
52
+
53
+ class Question(BaseModel):
54
+ id: str
55
+
56
+ created_at: datetime
57
+
58
+ created_by_user_id: str
59
+
60
+ prompt: str
61
+
62
+ title: str
63
+
64
+ type: Literal["categorical", "free_text", "rating", "number"]
65
+
66
+ choices: Optional[List[QuestionChoice]] = None
67
+
68
+ conditions: Optional[List[Dict[str, object]]] = None
69
+
70
+ dropdown: Optional[bool] = None
71
+
72
+ multi: Optional[bool] = None
73
+
74
+ number_options: Optional[QuestionNumberOptions] = FieldInfo(alias="numberOptions", default=None)
75
+
76
+ object: Optional[Literal["question"]] = None
77
+
78
+ override_config: Optional[QuestionOverrideConfig] = None
79
+ """
80
+ Specifies additional configurations to use for the question in the context of
81
+ the question set. For example, `{required: true}` sets the question as required.
82
+ Writes to the question_id_to_config field on the response
83
+ """
84
+
85
+ rating_options: Optional[QuestionRatingOptions] = FieldInfo(alias="ratingOptions", default=None)
86
+
87
+ required: Optional[bool] = None
88
+
89
+
90
+ class QuestionSet(BaseModel):
91
+ id: str
92
+
93
+ created_at: datetime
94
+
95
+ created_by_user_id: str
96
+
97
+ name: str
98
+
99
+ archived_at: Optional[datetime] = None
100
+
101
+ instructions: Optional[str] = None
102
+
103
+ object: Optional[Literal["question_set"]] = None
104
+
105
+ questions: Optional[List[Question]] = None
106
+ """Questions in the question set"""
@@ -0,0 +1,115 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from __future__ import annotations
4
+
5
+ from typing import Dict, List, Union, Iterable
6
+ from typing_extensions import Literal, Required, Annotated, TypeAlias, TypedDict
7
+
8
+ from .._utils import PropertyInfo
9
+
10
+ __all__ = [
11
+ "QuestionSetCreateParams",
12
+ "Question",
13
+ "QuestionQuestionCreateRequestWithConfig",
14
+ "QuestionQuestionCreateRequestWithConfigChoice",
15
+ "QuestionQuestionCreateRequestWithConfigNumberOptions",
16
+ "QuestionQuestionCreateRequestWithConfigOverrideConfig",
17
+ "QuestionQuestionCreateRequestWithConfigRatingOptions",
18
+ "QuestionQuestionIDWithConfiguration",
19
+ "QuestionQuestionIDWithConfigurationOverrideConfig",
20
+ ]
21
+
22
+
23
+ class QuestionSetCreateParams(TypedDict, total=False):
24
+ name: Required[str]
25
+
26
+ questions: Required[List[Question]]
27
+ """IDs of existing questions in the question set or new questions to create.
28
+
29
+ You can also optionally specify configurations for each question. Example:
30
+ [`question_id`, {'id': 'question_id2', 'configuration': {...}}, {'title': 'New
31
+ question', ...}]
32
+ """
33
+
34
+ instructions: str
35
+ """Instructions to answer questions"""
36
+
37
+
38
+ class QuestionQuestionCreateRequestWithConfigChoice(TypedDict, total=False):
39
+ label: Required[str]
40
+
41
+ value: Required[Union[str, bool, float]]
42
+
43
+ audit_required: bool
44
+
45
+
46
+ class QuestionQuestionCreateRequestWithConfigNumberOptions(TypedDict, total=False):
47
+ max: float
48
+ """Maximum value for the number"""
49
+
50
+ min: float
51
+ """Minimum value for the number"""
52
+
53
+
54
+ class QuestionQuestionCreateRequestWithConfigOverrideConfig(TypedDict, total=False):
55
+ required: bool
56
+ """Whether the question is required. False by default."""
57
+
58
+
59
+ class QuestionQuestionCreateRequestWithConfigRatingOptions(TypedDict, total=False):
60
+ max_label: Required[Annotated[str, PropertyInfo(alias="maxLabel")]]
61
+ """Maximum value for the rating"""
62
+
63
+ min_label: Required[Annotated[str, PropertyInfo(alias="minLabel")]]
64
+ """Minimum value for the rating"""
65
+
66
+ scale_steps: Required[Annotated[int, PropertyInfo(alias="scaleSteps")]]
67
+ """Number of steps in the rating scale"""
68
+
69
+
70
+ class QuestionQuestionCreateRequestWithConfig(TypedDict, total=False):
71
+ prompt: Required[str]
72
+
73
+ title: Required[str]
74
+
75
+ type: Required[Literal["categorical", "free_text", "rating", "number"]]
76
+
77
+ choices: Iterable[QuestionQuestionCreateRequestWithConfigChoice]
78
+
79
+ conditions: Iterable[Dict[str, object]]
80
+
81
+ dropdown: bool
82
+
83
+ multi: bool
84
+
85
+ number_options: Annotated[QuestionQuestionCreateRequestWithConfigNumberOptions, PropertyInfo(alias="numberOptions")]
86
+
87
+ override_config: QuestionQuestionCreateRequestWithConfigOverrideConfig
88
+ """
89
+ Specifies additional configurations to use for the question in the context of
90
+ the question set. For example, `{required: true}` sets the question as required.
91
+ Writes to the question_id_to_config field on the response
92
+ """
93
+
94
+ rating_options: Annotated[QuestionQuestionCreateRequestWithConfigRatingOptions, PropertyInfo(alias="ratingOptions")]
95
+
96
+ required: bool
97
+
98
+
99
+ class QuestionQuestionIDWithConfigurationOverrideConfig(TypedDict, total=False):
100
+ required: bool
101
+ """Whether the question is required. False by default."""
102
+
103
+
104
+ class QuestionQuestionIDWithConfiguration(TypedDict, total=False):
105
+ id: Required[str]
106
+
107
+ override_config: QuestionQuestionIDWithConfigurationOverrideConfig
108
+ """
109
+ Specifies additional configurations to use for the question in the context of
110
+ the question set. For example, `{required: true}` sets the question as required.
111
+ Writes to the question_id_to_config field on the response
112
+ """
113
+
114
+
115
+ Question: TypeAlias = Union[QuestionQuestionCreateRequestWithConfig, QuestionQuestionIDWithConfiguration, str]
@@ -0,0 +1,16 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from typing import Optional
4
+ from typing_extensions import Literal
5
+
6
+ from .._models import BaseModel
7
+
8
+ __all__ = ["QuestionSetDeleteResponse"]
9
+
10
+
11
+ class QuestionSetDeleteResponse(BaseModel):
12
+ id: str
13
+
14
+ deleted: bool
15
+
16
+ object: Optional[Literal["question_set"]] = None
@@ -0,0 +1,27 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from typing import List, Optional
4
+ from typing_extensions import Literal
5
+
6
+ from .._models import BaseModel
7
+ from .question_set import QuestionSet
8
+
9
+ __all__ = ["QuestionSetList"]
10
+
11
+
12
+ class QuestionSetList(BaseModel):
13
+ has_more: bool
14
+ """Whether there are more items left to be fetched."""
15
+
16
+ items: List[QuestionSet]
17
+
18
+ total: int
19
+ """The total of items that match the query.
20
+
21
+ This is greater than or equal to the number of items returned.
22
+ """
23
+
24
+ limit: Optional[int] = None
25
+ """The maximum number of items to return."""
26
+
27
+ object: Optional[Literal["list"]] = None
@@ -0,0 +1,20 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from __future__ import annotations
4
+
5
+ from typing import List, Optional
6
+ from typing_extensions import Literal, TypedDict
7
+
8
+ __all__ = ["QuestionSetListParams"]
9
+
10
+
11
+ class QuestionSetListParams(TypedDict, total=False):
12
+ ending_before: Optional[str]
13
+
14
+ include_archived: bool
15
+
16
+ limit: int
17
+
18
+ starting_after: Optional[str]
19
+
20
+ views: List[Literal["questions"]]
@@ -0,0 +1,12 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from __future__ import annotations
4
+
5
+ from typing import List
6
+ from typing_extensions import Literal, TypedDict
7
+
8
+ __all__ = ["QuestionSetRetrieveParams"]
9
+
10
+
11
+ class QuestionSetRetrieveParams(TypedDict, total=False):
12
+ views: List[Literal["questions"]]
@@ -0,0 +1,23 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from __future__ import annotations
4
+
5
+ from typing import Union
6
+ from typing_extensions import Literal, Required, TypeAlias, TypedDict
7
+
8
+ __all__ = ["QuestionSetUpdateParams", "PartialQuestionSetRequestBase", "RestoreRequest"]
9
+
10
+
11
+ class PartialQuestionSetRequestBase(TypedDict, total=False):
12
+ instructions: str
13
+ """Instructions to answer questions"""
14
+
15
+ name: str
16
+
17
+
18
+ class RestoreRequest(TypedDict, total=False):
19
+ restore: Required[Literal[True]]
20
+ """Set to true to restore the entity from the database."""
21
+
22
+
23
+ QuestionSetUpdateParams: TypeAlias = Union[PartialQuestionSetRequestBase, RestoreRequest]