mixpeek 0.21.7__py3-none-any.whl → 0.22.0__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 (84) hide show
  1. mixpeek/_hooks/types.py +7 -0
  2. mixpeek/_version.py +3 -3
  3. mixpeek/basesdk.py +12 -20
  4. mixpeek/bucketobjects.py +19 -37
  5. mixpeek/buckets.py +19 -31
  6. mixpeek/clusters.py +2 -0
  7. mixpeek/collectioncache.py +6 -0
  8. mixpeek/collections.py +13 -19
  9. mixpeek/features.py +4 -0
  10. mixpeek/health.py +2 -0
  11. mixpeek/httpclient.py +6 -16
  12. mixpeek/models/__init__.py +752 -583
  13. mixpeek/models/blobmodel.py +3 -11
  14. mixpeek/models/bucketcreaterequest.py +3 -11
  15. mixpeek/models/bucketresponse.py +3 -11
  16. mixpeek/models/bucketschemafield_input.py +6 -22
  17. mixpeek/models/bucketschemafield_output.py +6 -22
  18. mixpeek/models/bucketschemafieldbase.py +81 -0
  19. mixpeek/models/bucketschemafieldtype.py +1 -0
  20. mixpeek/models/bucketupdaterequest.py +3 -10
  21. mixpeek/models/collectionmodel.py +3 -11
  22. mixpeek/models/createblobrequest.py +3 -11
  23. mixpeek/models/createcollectionrequest.py +3 -11
  24. mixpeek/models/createnamespacerequest.py +9 -9
  25. mixpeek/models/createobjectrequest.py +3 -11
  26. mixpeek/models/createretrieverrequest.py +8 -16
  27. mixpeek/models/errordetail.py +3 -10
  28. mixpeek/models/featureextractorconfig.py +3 -11
  29. mixpeek/models/featureextractordefinition.py +26 -46
  30. mixpeek/models/interactionresponse.py +3 -11
  31. mixpeek/models/internal/__init__.py +35 -1
  32. mixpeek/models/logicaloperator_input.py +30 -36
  33. mixpeek/models/logicaloperator_output.py +39 -45
  34. mixpeek/models/logicaloperatorbase_input.py +74 -0
  35. mixpeek/models/logicaloperatorbase_output.py +74 -0
  36. mixpeek/models/namespaceresponse.py +17 -6
  37. mixpeek/models/namespacestatus.py +10 -0
  38. mixpeek/models/objectresponse.py +3 -11
  39. mixpeek/models/organizationmodel.py +3 -11
  40. mixpeek/models/retrieverbinding.py +3 -10
  41. mixpeek/models/retrievermodel.py +11 -16
  42. mixpeek/models/retrieverqueryrequest.py +3 -11
  43. mixpeek/models/retrieverschema_input.py +37 -0
  44. mixpeek/models/retrieverschema_output.py +37 -0
  45. mixpeek/models/retrieverschemafield_input.py +91 -0
  46. mixpeek/models/retrieverschemafield_output.py +91 -0
  47. mixpeek/models/searchinteraction.py +3 -11
  48. mixpeek/models/stageconfig_input.py +8 -16
  49. mixpeek/models/stageconfig_output.py +8 -16
  50. mixpeek/models/stagedefinition.py +28 -17
  51. mixpeek/models/stageresponse.py +3 -11
  52. mixpeek/models/updateobjectrequest.py +3 -11
  53. mixpeek/models/usermodel_input.py +3 -11
  54. mixpeek/models/usermodel_output.py +3 -11
  55. mixpeek/namespaces.py +28 -22
  56. mixpeek/organizationnotifications.py +2 -0
  57. mixpeek/organizations.py +13 -13
  58. mixpeek/organizationsusage.py +2 -0
  59. mixpeek/research.py +2 -0
  60. mixpeek/retrieverinteractions.py +13 -19
  61. mixpeek/retrievers.py +21 -39
  62. mixpeek/retrieverstages.py +2 -0
  63. mixpeek/sdk.py +94 -65
  64. mixpeek/sdkconfiguration.py +0 -7
  65. mixpeek/tasks.py +6 -0
  66. mixpeek/taxonomies.py +2 -0
  67. mixpeek/users.py +6 -0
  68. mixpeek/utils/__init__.py +131 -45
  69. mixpeek/utils/datetimes.py +23 -0
  70. mixpeek/utils/serializers.py +32 -3
  71. {mixpeek-0.21.7.dist-info → mixpeek-0.22.0.dist-info}/METADATA +3 -15
  72. {mixpeek-0.21.7.dist-info → mixpeek-0.22.0.dist-info}/RECORD +73 -75
  73. {mixpeek-0.21.7.dist-info → mixpeek-0.22.0.dist-info}/WHEEL +1 -1
  74. mixpeek/collectiondocuments.py +0 -1564
  75. mixpeek/models/batch_delete_documents_v1_collections_collection_identifier_documents_batch_deleteop.py +0 -75
  76. mixpeek/models/batch_update_documents_v1_collections_collection_identifier_documents_batch_putop.py +0 -84
  77. mixpeek/models/delete_document_v1_collections_collection_identifier_documents_document_id_deleteop.py +0 -70
  78. mixpeek/models/documentlistresponse.py +0 -56
  79. mixpeek/models/documentresponse.py +0 -87
  80. mixpeek/models/documentupdate.py +0 -60
  81. mixpeek/models/genericsuccessresponse.py +0 -17
  82. mixpeek/models/get_document_v1_collections_collection_identifier_documents_document_id_getop.py +0 -70
  83. mixpeek/models/list_documents_v1_collections_collection_identifier_documents_getop.py +0 -114
  84. mixpeek/models/update_document_v1_collections_collection_identifier_documents_document_id_putop.py +0 -83
@@ -1,17 +1,22 @@
1
1
  """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
2
2
 
3
3
  from __future__ import annotations
4
- from mixpeek.types import BaseModel, Nullable, UNSET_SENTINEL
4
+ from .basicfeatureextractor import BasicFeatureExtractor, BasicFeatureExtractorTypedDict
5
+ from .namespacestatus import NamespaceStatus
6
+ from mixpeek.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL
5
7
  from pydantic import model_serializer
6
8
  from typing import Any, List
7
- from typing_extensions import TypedDict
9
+ from typing_extensions import NotRequired, TypedDict
8
10
 
9
11
 
10
12
  class NamespaceResponseTypedDict(TypedDict):
11
13
  namespace_id: str
12
14
  namespace_name: str
13
- embedding_models: List[str]
15
+ description: Nullable[str]
16
+ feature_extractors: List[BasicFeatureExtractorTypedDict]
14
17
  payload_indexes: Nullable[List[Any]]
18
+ status: NamespaceStatus
19
+ provisioning_task_id: NotRequired[Nullable[str]]
15
20
 
16
21
 
17
22
  class NamespaceResponse(BaseModel):
@@ -19,14 +24,20 @@ class NamespaceResponse(BaseModel):
19
24
 
20
25
  namespace_name: str
21
26
 
22
- embedding_models: List[str]
27
+ description: Nullable[str]
28
+
29
+ feature_extractors: List[BasicFeatureExtractor]
23
30
 
24
31
  payload_indexes: Nullable[List[Any]]
25
32
 
33
+ status: NamespaceStatus
34
+
35
+ provisioning_task_id: OptionalNullable[str] = UNSET
36
+
26
37
  @model_serializer(mode="wrap")
27
38
  def serialize_model(self, handler):
28
- optional_fields = []
29
- nullable_fields = ["payload_indexes"]
39
+ optional_fields = ["provisioning_task_id"]
40
+ nullable_fields = ["description", "payload_indexes", "provisioning_task_id"]
30
41
  null_default_fields = []
31
42
 
32
43
  serialized = handler(self)
@@ -0,0 +1,10 @@
1
+ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
2
+
3
+ from __future__ import annotations
4
+ from enum import Enum
5
+
6
+
7
+ class NamespaceStatus(str, Enum):
8
+ PENDING = "pending"
9
+ READY = "ready"
10
+ FAILED = "failed"
@@ -6,18 +6,10 @@ from .taskstatus import TaskStatus
6
6
  from datetime import datetime
7
7
  from mixpeek.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL
8
8
  from pydantic import model_serializer
9
- from typing import List
9
+ from typing import Any, Dict, List
10
10
  from typing_extensions import NotRequired, TypedDict
11
11
 
12
12
 
13
- class ObjectResponseMetadataTypedDict(TypedDict):
14
- r"""Additional metadata for the object, appended to downstream documents of connected collections"""
15
-
16
-
17
- class ObjectResponseMetadata(BaseModel):
18
- r"""Additional metadata for the object, appended to downstream documents of connected collections"""
19
-
20
-
21
13
  class ObjectResponseTypedDict(TypedDict):
22
14
  r"""Response model for bucket objects"""
23
15
 
@@ -28,7 +20,7 @@ class ObjectResponseTypedDict(TypedDict):
28
20
  blobs: List[BlobModelTypedDict]
29
21
  r"""List of blobs contained in this object"""
30
22
  status: TaskStatus
31
- metadata: ObjectResponseMetadataTypedDict
23
+ metadata: Dict[str, Any]
32
24
  r"""Additional metadata for the object, appended to downstream documents of connected collections"""
33
25
  task_id: NotRequired[Nullable[str]]
34
26
  r"""ID of the task that created this object, used to track the object creation progress and status"""
@@ -58,7 +50,7 @@ class ObjectResponse(BaseModel):
58
50
 
59
51
  status: TaskStatus
60
52
 
61
- metadata: ObjectResponseMetadata
53
+ metadata: Dict[str, Any]
62
54
  r"""Additional metadata for the object, appended to downstream documents of connected collections"""
63
55
 
64
56
  task_id: OptionalNullable[str] = UNSET
@@ -4,18 +4,10 @@ from __future__ import annotations
4
4
  from .usermodel_output import UserModelOutput, UserModelOutputTypedDict
5
5
  from datetime import datetime
6
6
  from mixpeek.types import BaseModel
7
- from typing import List, Optional
7
+ from typing import Any, Dict, List, Optional
8
8
  from typing_extensions import NotRequired, TypedDict
9
9
 
10
10
 
11
- class OrganizationModelMetadataTypedDict(TypedDict):
12
- pass
13
-
14
-
15
- class OrganizationModelMetadata(BaseModel):
16
- pass
17
-
18
-
19
11
  class OrganizationModelTypedDict(TypedDict):
20
12
  organization_name: str
21
13
  organization_id: NotRequired[str]
@@ -23,7 +15,7 @@ class OrganizationModelTypedDict(TypedDict):
23
15
  created_at: NotRequired[datetime]
24
16
  account_type: NotRequired[str]
25
17
  credit_count: NotRequired[int]
26
- metadata: NotRequired[OrganizationModelMetadataTypedDict]
18
+ metadata: NotRequired[Dict[str, Any]]
27
19
  users: NotRequired[List[UserModelOutputTypedDict]]
28
20
 
29
21
 
@@ -40,6 +32,6 @@ class OrganizationModel(BaseModel):
40
32
 
41
33
  credit_count: Optional[int] = 1000
42
34
 
43
- metadata: Optional[OrganizationModelMetadata] = None
35
+ metadata: Optional[Dict[str, Any]] = None
44
36
 
45
37
  users: Optional[List[UserModelOutput]] = None
@@ -3,23 +3,16 @@
3
3
  from __future__ import annotations
4
4
  from mixpeek.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL
5
5
  from pydantic import model_serializer
6
+ from typing import Any, Dict
6
7
  from typing_extensions import NotRequired, TypedDict
7
8
 
8
9
 
9
- class InputsTypedDict(TypedDict):
10
- pass
11
-
12
-
13
- class Inputs(BaseModel):
14
- pass
15
-
16
-
17
10
  class RetrieverBindingTypedDict(TypedDict):
18
11
  r"""How a retriever should be used in a taxonomy"""
19
12
 
20
13
  retriever_id: str
21
14
  r"""ID of the retriever to use"""
22
- inputs: NotRequired[Nullable[InputsTypedDict]]
15
+ inputs: NotRequired[Nullable[Dict[str, Any]]]
23
16
  r"""Optional inputs to the retriever. If not provided, will use source collection schema"""
24
17
 
25
18
 
@@ -29,7 +22,7 @@ class RetrieverBinding(BaseModel):
29
22
  retriever_id: str
30
23
  r"""ID of the retriever to use"""
31
24
 
32
- inputs: OptionalNullable[Inputs] = UNSET
25
+ inputs: OptionalNullable[Dict[str, Any]] = UNSET
33
26
  r"""Optional inputs to the retriever. If not provided, will use source collection schema"""
34
27
 
35
28
  @model_serializer(mode="wrap")
@@ -1,30 +1,25 @@
1
1
  """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
2
2
 
3
3
  from __future__ import annotations
4
- from .bucketschema_output import BucketSchemaOutput, BucketSchemaOutputTypedDict
5
4
  from .retrievercacheconfig import RetrieverCacheConfig, RetrieverCacheConfigTypedDict
5
+ from .retrieverschema_output import (
6
+ RetrieverSchemaOutput,
7
+ RetrieverSchemaOutputTypedDict,
8
+ )
6
9
  from .stageconfig_output import StageConfigOutput, StageConfigOutputTypedDict
7
10
  from mixpeek.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL
8
11
  from pydantic import model_serializer
9
- from typing import List, Optional
12
+ from typing import Any, Dict, List, Optional
10
13
  from typing_extensions import NotRequired, TypedDict
11
14
 
12
15
 
13
- class RetrieverModelMetadataTypedDict(TypedDict):
14
- pass
15
-
16
-
17
- class RetrieverModelMetadata(BaseModel):
18
- pass
19
-
20
-
21
16
  class RetrieverModelTypedDict(TypedDict):
22
17
  r"""Definition of a retriever"""
23
18
 
24
19
  retriever_name: str
25
20
  r"""Name of the retriever"""
26
- input_schema: BucketSchemaOutputTypedDict
27
- r"""Schema definition for bucket objects"""
21
+ input_schema: RetrieverSchemaOutputTypedDict
22
+ r"""Schema definition for retriever inputs"""
28
23
  collection_ids: List[str]
29
24
  r"""List of collection IDs to search in"""
30
25
  stages: List[StageConfigOutputTypedDict]
@@ -33,7 +28,7 @@ class RetrieverModelTypedDict(TypedDict):
33
28
  r"""Unique identifier for the retriever"""
34
29
  description: NotRequired[Nullable[str]]
35
30
  r"""Description of the retriever"""
36
- metadata: NotRequired[RetrieverModelMetadataTypedDict]
31
+ metadata: NotRequired[Dict[str, Any]]
37
32
  cache_config: NotRequired[Nullable[RetrieverCacheConfigTypedDict]]
38
33
  r"""Configuration for retriever-level caching"""
39
34
 
@@ -44,8 +39,8 @@ class RetrieverModel(BaseModel):
44
39
  retriever_name: str
45
40
  r"""Name of the retriever"""
46
41
 
47
- input_schema: BucketSchemaOutput
48
- r"""Schema definition for bucket objects"""
42
+ input_schema: RetrieverSchemaOutput
43
+ r"""Schema definition for retriever inputs"""
49
44
 
50
45
  collection_ids: List[str]
51
46
  r"""List of collection IDs to search in"""
@@ -59,7 +54,7 @@ class RetrieverModel(BaseModel):
59
54
  description: OptionalNullable[str] = UNSET
60
55
  r"""Description of the retriever"""
61
56
 
62
- metadata: Optional[RetrieverModelMetadata] = None
57
+ metadata: Optional[Dict[str, Any]] = None
63
58
 
64
59
  cache_config: OptionalNullable[RetrieverCacheConfig] = UNSET
65
60
  r"""Configuration for retriever-level caching"""
@@ -5,18 +5,10 @@ from .logicaloperator_input import LogicalOperatorInput, LogicalOperatorInputTyp
5
5
  from .sortoption import SortOption, SortOptionTypedDict
6
6
  from mixpeek.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL
7
7
  from pydantic import model_serializer
8
- from typing import List, Optional
8
+ from typing import Any, Dict, List, Optional
9
9
  from typing_extensions import NotRequired, TypedDict
10
10
 
11
11
 
12
- class RetrieverQueryRequestInputsTypedDict(TypedDict):
13
- r"""Input values for the retriever query. These map to the required inputs defined in the retriever's first stage."""
14
-
15
-
16
- class RetrieverQueryRequestInputs(BaseModel):
17
- r"""Input values for the retriever query. These map to the required inputs defined in the retriever's first stage."""
18
-
19
-
20
12
  class RetrieverQueryRequestTypedDict(TypedDict):
21
13
  r"""Query parameters for executing a retriever pipeline.
22
14
 
@@ -25,7 +17,7 @@ class RetrieverQueryRequestTypedDict(TypedDict):
25
17
  query inputs, filtering, sorting, pagination, and result formatting.
26
18
  """
27
19
 
28
- inputs: RetrieverQueryRequestInputsTypedDict
20
+ inputs: Dict[str, Any]
29
21
  r"""Input values for the retriever query. These map to the required inputs defined in the retriever's first stage."""
30
22
  filters: NotRequired[Nullable[LogicalOperatorInputTypedDict]]
31
23
  r"""Logical operations for filtering results. Can include AND, OR, NOT conditions with field comparisons."""
@@ -51,7 +43,7 @@ class RetrieverQueryRequest(BaseModel):
51
43
  query inputs, filtering, sorting, pagination, and result formatting.
52
44
  """
53
45
 
54
- inputs: RetrieverQueryRequestInputs
46
+ inputs: Dict[str, Any]
55
47
  r"""Input values for the retriever query. These map to the required inputs defined in the retriever's first stage."""
56
48
 
57
49
  filters: OptionalNullable[LogicalOperatorInput] = UNSET
@@ -0,0 +1,37 @@
1
+ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
2
+
3
+ from __future__ import annotations
4
+ from .retrieverschemafield_input import (
5
+ RetrieverSchemaFieldInput,
6
+ RetrieverSchemaFieldInputTypedDict,
7
+ )
8
+ from mixpeek.types import BaseModel
9
+ import pydantic
10
+ from pydantic import ConfigDict
11
+ from typing import Any, Dict
12
+ from typing_extensions import TypedDict
13
+
14
+
15
+ class RetrieverSchemaInputTypedDict(TypedDict):
16
+ r"""Schema definition for retriever inputs"""
17
+
18
+ properties: Dict[str, RetrieverSchemaFieldInputTypedDict]
19
+
20
+
21
+ class RetrieverSchemaInput(BaseModel):
22
+ r"""Schema definition for retriever inputs"""
23
+
24
+ model_config = ConfigDict(
25
+ populate_by_name=True, arbitrary_types_allowed=True, extra="allow"
26
+ )
27
+ __pydantic_extra__: Dict[str, Any] = pydantic.Field(init=False)
28
+
29
+ properties: Dict[str, RetrieverSchemaFieldInput]
30
+
31
+ @property
32
+ def additional_properties(self):
33
+ return self.__pydantic_extra__
34
+
35
+ @additional_properties.setter
36
+ def additional_properties(self, value):
37
+ self.__pydantic_extra__ = value # pyright: ignore[reportIncompatibleVariableOverride]
@@ -0,0 +1,37 @@
1
+ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
2
+
3
+ from __future__ import annotations
4
+ from .retrieverschemafield_output import (
5
+ RetrieverSchemaFieldOutput,
6
+ RetrieverSchemaFieldOutputTypedDict,
7
+ )
8
+ from mixpeek.types import BaseModel
9
+ import pydantic
10
+ from pydantic import ConfigDict
11
+ from typing import Any, Dict
12
+ from typing_extensions import TypedDict
13
+
14
+
15
+ class RetrieverSchemaOutputTypedDict(TypedDict):
16
+ r"""Schema definition for retriever inputs"""
17
+
18
+ properties: Dict[str, RetrieverSchemaFieldOutputTypedDict]
19
+
20
+
21
+ class RetrieverSchemaOutput(BaseModel):
22
+ r"""Schema definition for retriever inputs"""
23
+
24
+ model_config = ConfigDict(
25
+ populate_by_name=True, arbitrary_types_allowed=True, extra="allow"
26
+ )
27
+ __pydantic_extra__: Dict[str, Any] = pydantic.Field(init=False)
28
+
29
+ properties: Dict[str, RetrieverSchemaFieldOutput]
30
+
31
+ @property
32
+ def additional_properties(self):
33
+ return self.__pydantic_extra__
34
+
35
+ @additional_properties.setter
36
+ def additional_properties(self, value):
37
+ self.__pydantic_extra__ = value # pyright: ignore[reportIncompatibleVariableOverride]
@@ -0,0 +1,91 @@
1
+ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
2
+
3
+ from __future__ import annotations
4
+ from .bucketschemafieldbase import BucketSchemaFieldBase, BucketSchemaFieldBaseTypedDict
5
+ from .bucketschemafieldtype import BucketSchemaFieldType
6
+ from mixpeek.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL
7
+ from pydantic import model_serializer
8
+ from typing import Any, Dict, List, Optional
9
+ from typing_extensions import NotRequired, TypedDict
10
+
11
+
12
+ class RetrieverSchemaFieldInputTypedDict(TypedDict):
13
+ r"""Schema field definition for retriever inputs"""
14
+
15
+ type: BucketSchemaFieldType
16
+ r"""Enum for field types in bucket schemas"""
17
+ default: NotRequired[Nullable[Any]]
18
+ items: NotRequired[Nullable[BucketSchemaFieldBaseTypedDict]]
19
+ properties: NotRequired[Nullable[Dict[str, BucketSchemaFieldBaseTypedDict]]]
20
+ example: NotRequired[Nullable[Any]]
21
+ description: NotRequired[Nullable[str]]
22
+ enum: NotRequired[Nullable[List[Any]]]
23
+ required: NotRequired[bool]
24
+ r"""Whether this field is required for the retriever"""
25
+
26
+
27
+ class RetrieverSchemaFieldInput(BaseModel):
28
+ r"""Schema field definition for retriever inputs"""
29
+
30
+ type: BucketSchemaFieldType
31
+ r"""Enum for field types in bucket schemas"""
32
+
33
+ default: OptionalNullable[Any] = UNSET
34
+
35
+ items: OptionalNullable[BucketSchemaFieldBase] = UNSET
36
+
37
+ properties: OptionalNullable[Dict[str, BucketSchemaFieldBase]] = UNSET
38
+
39
+ example: OptionalNullable[Any] = UNSET
40
+
41
+ description: OptionalNullable[str] = UNSET
42
+
43
+ enum: OptionalNullable[List[Any]] = UNSET
44
+
45
+ required: Optional[bool] = True
46
+ r"""Whether this field is required for the retriever"""
47
+
48
+ @model_serializer(mode="wrap")
49
+ def serialize_model(self, handler):
50
+ optional_fields = [
51
+ "default",
52
+ "items",
53
+ "properties",
54
+ "example",
55
+ "description",
56
+ "enum",
57
+ "required",
58
+ ]
59
+ nullable_fields = [
60
+ "default",
61
+ "items",
62
+ "properties",
63
+ "example",
64
+ "description",
65
+ "enum",
66
+ ]
67
+ null_default_fields = []
68
+
69
+ serialized = handler(self)
70
+
71
+ m = {}
72
+
73
+ for n, f in type(self).model_fields.items():
74
+ k = f.alias or n
75
+ val = serialized.get(k)
76
+ serialized.pop(k, None)
77
+
78
+ optional_nullable = k in optional_fields and k in nullable_fields
79
+ is_set = (
80
+ self.__pydantic_fields_set__.intersection({n})
81
+ or k in null_default_fields
82
+ ) # pylint: disable=no-member
83
+
84
+ if val is not None and val != UNSET_SENTINEL:
85
+ m[k] = val
86
+ elif val != UNSET_SENTINEL and (
87
+ not k in optional_fields or (optional_nullable and is_set)
88
+ ):
89
+ m[k] = val
90
+
91
+ return m
@@ -0,0 +1,91 @@
1
+ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
2
+
3
+ from __future__ import annotations
4
+ from .bucketschemafieldbase import BucketSchemaFieldBase, BucketSchemaFieldBaseTypedDict
5
+ from .bucketschemafieldtype import BucketSchemaFieldType
6
+ from mixpeek.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL
7
+ from pydantic import model_serializer
8
+ from typing import Any, Dict, List, Optional
9
+ from typing_extensions import NotRequired, TypedDict
10
+
11
+
12
+ class RetrieverSchemaFieldOutputTypedDict(TypedDict):
13
+ r"""Schema field definition for retriever inputs"""
14
+
15
+ type: BucketSchemaFieldType
16
+ r"""Enum for field types in bucket schemas"""
17
+ default: NotRequired[Nullable[Any]]
18
+ items: NotRequired[Nullable[BucketSchemaFieldBaseTypedDict]]
19
+ properties: NotRequired[Nullable[Dict[str, BucketSchemaFieldBaseTypedDict]]]
20
+ example: NotRequired[Nullable[Any]]
21
+ description: NotRequired[Nullable[str]]
22
+ enum: NotRequired[Nullable[List[Any]]]
23
+ required: NotRequired[bool]
24
+ r"""Whether this field is required for the retriever"""
25
+
26
+
27
+ class RetrieverSchemaFieldOutput(BaseModel):
28
+ r"""Schema field definition for retriever inputs"""
29
+
30
+ type: BucketSchemaFieldType
31
+ r"""Enum for field types in bucket schemas"""
32
+
33
+ default: OptionalNullable[Any] = UNSET
34
+
35
+ items: OptionalNullable[BucketSchemaFieldBase] = UNSET
36
+
37
+ properties: OptionalNullable[Dict[str, BucketSchemaFieldBase]] = UNSET
38
+
39
+ example: OptionalNullable[Any] = UNSET
40
+
41
+ description: OptionalNullable[str] = UNSET
42
+
43
+ enum: OptionalNullable[List[Any]] = UNSET
44
+
45
+ required: Optional[bool] = True
46
+ r"""Whether this field is required for the retriever"""
47
+
48
+ @model_serializer(mode="wrap")
49
+ def serialize_model(self, handler):
50
+ optional_fields = [
51
+ "default",
52
+ "items",
53
+ "properties",
54
+ "example",
55
+ "description",
56
+ "enum",
57
+ "required",
58
+ ]
59
+ nullable_fields = [
60
+ "default",
61
+ "items",
62
+ "properties",
63
+ "example",
64
+ "description",
65
+ "enum",
66
+ ]
67
+ null_default_fields = []
68
+
69
+ serialized = handler(self)
70
+
71
+ m = {}
72
+
73
+ for n, f in type(self).model_fields.items():
74
+ k = f.alias or n
75
+ val = serialized.get(k)
76
+ serialized.pop(k, None)
77
+
78
+ optional_nullable = k in optional_fields and k in nullable_fields
79
+ is_set = (
80
+ self.__pydantic_fields_set__.intersection({n})
81
+ or k in null_default_fields
82
+ ) # pylint: disable=no-member
83
+
84
+ if val is not None and val != UNSET_SENTINEL:
85
+ m[k] = val
86
+ elif val != UNSET_SENTINEL and (
87
+ not k in optional_fields or (optional_nullable and is_set)
88
+ ):
89
+ m[k] = val
90
+
91
+ return m
@@ -4,18 +4,10 @@ from __future__ import annotations
4
4
  from .interactiontype import InteractionType
5
5
  from mixpeek.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL
6
6
  from pydantic import model_serializer
7
- from typing import List
7
+ from typing import Any, Dict, List
8
8
  from typing_extensions import NotRequired, TypedDict
9
9
 
10
10
 
11
- class SearchInteractionMetadataTypedDict(TypedDict):
12
- pass
13
-
14
-
15
- class SearchInteractionMetadata(BaseModel):
16
- pass
17
-
18
-
19
11
  class SearchInteractionTypedDict(TypedDict):
20
12
  feature_id: str
21
13
  r"""ID of the item that was interacted with"""
@@ -23,7 +15,7 @@ class SearchInteractionTypedDict(TypedDict):
23
15
  r"""Type of interaction or feedback"""
24
16
  position: NotRequired[Nullable[int]]
25
17
  r"""Position in search results where interaction occurred"""
26
- metadata: NotRequired[Nullable[SearchInteractionMetadataTypedDict]]
18
+ metadata: NotRequired[Nullable[Dict[str, Any]]]
27
19
  r"""Additional context about the interaction"""
28
20
  user_id: NotRequired[Nullable[str]]
29
21
  r"""Customer's authenticated user identifier - persists across sessions"""
@@ -41,7 +33,7 @@ class SearchInteraction(BaseModel):
41
33
  position: OptionalNullable[int] = UNSET
42
34
  r"""Position in search results where interaction occurred"""
43
35
 
44
- metadata: OptionalNullable[SearchInteractionMetadata] = UNSET
36
+ metadata: OptionalNullable[Dict[str, Any]] = UNSET
45
37
  r"""Additional context about the interaction"""
46
38
 
47
39
  user_id: OptionalNullable[str] = UNSET
@@ -4,18 +4,10 @@ from __future__ import annotations
4
4
  from .logicaloperator_input import LogicalOperatorInput, LogicalOperatorInputTypedDict
5
5
  from mixpeek.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL
6
6
  from pydantic import model_serializer
7
- from typing import Optional
7
+ from typing import Any, Dict, Optional
8
8
  from typing_extensions import NotRequired, TypedDict
9
9
 
10
10
 
11
- class StageConfigInputParametersTypedDict(TypedDict):
12
- r"""Parameters for the stage"""
13
-
14
-
15
- class StageConfigInputParameters(BaseModel):
16
- r"""Parameters for the stage"""
17
-
18
-
19
11
  class StageConfigInputTypedDict(TypedDict):
20
12
  r"""Configuration for how a retriever stage processes queries and handles results.
21
13
 
@@ -24,13 +16,13 @@ class StageConfigInputTypedDict(TypedDict):
24
16
  with consistent options.
25
17
  """
26
18
 
19
+ stage_id: str
20
+ r"""Unique identifier for the stage"""
27
21
  stage_name: str
28
22
  r"""Name of the stage"""
29
23
  version: str
30
24
  r"""Version of the stage"""
31
- module_path: str
32
- r"""Python module path for the stage"""
33
- parameters: NotRequired[StageConfigInputParametersTypedDict]
25
+ parameters: NotRequired[Dict[str, Any]]
34
26
  r"""Parameters for the stage"""
35
27
  pre_filters: NotRequired[Nullable[LogicalOperatorInputTypedDict]]
36
28
  r"""Filters to apply before the main search is executed"""
@@ -50,16 +42,16 @@ class StageConfigInput(BaseModel):
50
42
  with consistent options.
51
43
  """
52
44
 
45
+ stage_id: str
46
+ r"""Unique identifier for the stage"""
47
+
53
48
  stage_name: str
54
49
  r"""Name of the stage"""
55
50
 
56
51
  version: str
57
52
  r"""Version of the stage"""
58
53
 
59
- module_path: str
60
- r"""Python module path for the stage"""
61
-
62
- parameters: Optional[StageConfigInputParameters] = None
54
+ parameters: Optional[Dict[str, Any]] = None
63
55
  r"""Parameters for the stage"""
64
56
 
65
57
  pre_filters: OptionalNullable[LogicalOperatorInput] = UNSET