clarifai-grpc 6.4.0__py3-none-any.whl → 11.10.3__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 (50) hide show
  1. clarifai_grpc/__init__.py +33 -0
  2. clarifai_grpc/channel/clarifai_channel.py +150 -44
  3. clarifai_grpc/channel/custom_converters/custom_dict_to_message.py +41 -34
  4. clarifai_grpc/channel/custom_converters/custom_message_to_dict.py +85 -74
  5. clarifai_grpc/channel/errors.py +5 -0
  6. clarifai_grpc/channel/exceptions.py +1 -1
  7. clarifai_grpc/channel/grpc_json_channel.py +387 -261
  8. clarifai_grpc/channel/http_client.py +125 -104
  9. clarifai_grpc/grpc/api/resources_pb2.py +984 -7266
  10. clarifai_grpc/grpc/api/resources_pb2.pyi +17925 -0
  11. clarifai_grpc/grpc/api/resources_pb2_grpc.py +1 -0
  12. clarifai_grpc/grpc/api/service_pb2.py +1578 -8672
  13. clarifai_grpc/grpc/api/service_pb2.pyi +18269 -0
  14. clarifai_grpc/grpc/api/service_pb2_grpc.py +9746 -1859
  15. clarifai_grpc/grpc/api/status/status_code_pb2.py +33 -1334
  16. clarifai_grpc/grpc/api/status/status_code_pb2.pyi +1210 -0
  17. clarifai_grpc/grpc/api/status/status_code_pb2_grpc.py +1 -0
  18. clarifai_grpc/grpc/api/status/status_pb2.py +23 -149
  19. clarifai_grpc/grpc/api/status/status_pb2.pyi +174 -0
  20. clarifai_grpc/grpc/api/status/status_pb2_grpc.py +1 -0
  21. clarifai_grpc/grpc/api/utils/extensions_pb2.py +13 -46
  22. clarifai_grpc/grpc/api/utils/extensions_pb2.pyi +39 -0
  23. clarifai_grpc/grpc/api/utils/extensions_pb2_grpc.py +1 -0
  24. clarifai_grpc/grpc/api/utils/matrix_pb2.py +26 -0
  25. clarifai_grpc/grpc/api/utils/matrix_pb2.pyi +53 -0
  26. clarifai_grpc/grpc/api/utils/matrix_pb2_grpc.py +4 -0
  27. clarifai_grpc/grpc/api/utils/test_proto_pb2.py +17 -158
  28. clarifai_grpc/grpc/api/utils/test_proto_pb2.pyi +107 -0
  29. clarifai_grpc/grpc/api/utils/test_proto_pb2_grpc.py +1 -0
  30. clarifai_grpc/grpc/auth/scope/scope_pb2.py +245 -448
  31. clarifai_grpc/grpc/auth/scope/scope_pb2.pyi +550 -0
  32. clarifai_grpc/grpc/auth/scope/scope_pb2_grpc.py +1 -0
  33. clarifai_grpc/grpc/auth/types/types_pb2.py +11 -62
  34. clarifai_grpc/grpc/auth/types/types_pb2.pyi +78 -0
  35. clarifai_grpc/grpc/auth/types/types_pb2_grpc.py +1 -0
  36. clarifai_grpc/grpc/auth/util/extension_pb2.py +14 -68
  37. clarifai_grpc/grpc/auth/util/extension_pb2.pyi +68 -0
  38. clarifai_grpc/grpc/auth/util/extension_pb2_grpc.py +1 -0
  39. clarifai_grpc-11.10.3.dist-info/METADATA +124 -0
  40. clarifai_grpc-11.10.3.dist-info/RECORD +53 -0
  41. {clarifai_grpc-6.4.0.dist-info → clarifai_grpc-11.10.3.dist-info}/WHEEL +1 -1
  42. {clarifai_grpc-6.4.0.dist-info → clarifai_grpc-11.10.3.dist-info}/top_level.txt +0 -2
  43. clarifai_grpc-6.4.0.dist-info/METADATA +0 -88
  44. clarifai_grpc-6.4.0.dist-info/RECORD +0 -46
  45. scripts/__init__.py +0 -0
  46. scripts/app_and_key_for_tests.py +0 -180
  47. tests/__init__.py +0 -0
  48. tests/helpers.py +0 -105
  49. tests/test_integration.py +0 -243
  50. {clarifai_grpc-6.4.0.dist-info → clarifai_grpc-11.10.3.dist-info/licenses}/LICENSE +0 -0
@@ -1,3 +1,4 @@
1
1
  # Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
2
+ """Client and server classes corresponding to protobuf-defined services."""
2
3
  import grpc
3
4
 
@@ -1,10 +1,10 @@
1
1
  # -*- coding: utf-8 -*-
2
2
  # Generated by the protocol buffer compiler. DO NOT EDIT!
3
3
  # source: proto/clarifai/api/status/status.proto
4
-
4
+ """Generated protocol buffer code."""
5
+ from google.protobuf.internal import builder as _builder
5
6
  from google.protobuf import descriptor as _descriptor
6
- from google.protobuf import message as _message
7
- from google.protobuf import reflection as _reflection
7
+ from google.protobuf import descriptor_pool as _descriptor_pool
8
8
  from google.protobuf import symbol_database as _symbol_database
9
9
  # @@protoc_insertion_point(imports)
10
10
 
@@ -15,150 +15,24 @@ from clarifai_grpc.grpc.auth.util import extension_pb2 as proto_dot_clarifai_dot
15
15
  from clarifai_grpc.grpc.api.status import status_code_pb2 as proto_dot_clarifai_dot_api_dot_status_dot_status__code__pb2
16
16
 
17
17
 
18
- DESCRIPTOR = _descriptor.FileDescriptor(
19
- name='proto/clarifai/api/status/status.proto',
20
- package='clarifai.api.status',
21
- syntax='proto3',
22
- serialized_options=b'\n\034com.clarifai.grpc.api.statusP\001Z\006status\242\002\004CAIP',
23
- serialized_pb=b'\n&proto/clarifai/api/status/status.proto\x12\x13\x63larifai.api.status\x1a(proto/clarifai/auth/util/extension.proto\x1a+proto/clarifai/api/status/status_code.proto\"\xdb\x01\n\x06Status\x12-\n\x04\x63ode\x18\x01 \x01(\x0e\x32\x1f.clarifai.api.status.StatusCode\x12\x13\n\x0b\x64\x65scription\x18\x02 \x01(\t\x12\x0f\n\x07\x64\x65tails\x18\x03 \x01(\t\x12\x19\n\x0bstack_trace\x18\x04 \x03(\tB\x04\x80\x9c\'\x01\x12\x19\n\x11percent_completed\x18\x05 \x01(\r\x12\x16\n\x0etime_remaining\x18\x06 \x01(\r\x12\x0e\n\x06req_id\x18\x07 \x01(\t\x12\x1e\n\x10internal_details\x18\x08 \x01(\tB\x04\x80\x9c\'\x01\";\n\x0c\x42\x61seResponse\x12+\n\x06status\x18\x01 \x01(\x0b\x32\x1b.clarifai.api.status.StatusB/\n\x1c\x63om.clarifai.grpc.api.statusP\x01Z\x06status\xa2\x02\x04\x43\x41IPb\x06proto3'
24
- ,
25
- dependencies=[proto_dot_clarifai_dot_auth_dot_util_dot_extension__pb2.DESCRIPTOR,proto_dot_clarifai_dot_api_dot_status_dot_status__code__pb2.DESCRIPTOR,])
26
-
27
-
28
-
29
-
30
- _STATUS = _descriptor.Descriptor(
31
- name='Status',
32
- full_name='clarifai.api.status.Status',
33
- filename=None,
34
- file=DESCRIPTOR,
35
- containing_type=None,
36
- fields=[
37
- _descriptor.FieldDescriptor(
38
- name='code', full_name='clarifai.api.status.Status.code', index=0,
39
- number=1, type=14, cpp_type=8, label=1,
40
- has_default_value=False, default_value=0,
41
- message_type=None, enum_type=None, containing_type=None,
42
- is_extension=False, extension_scope=None,
43
- serialized_options=None, file=DESCRIPTOR),
44
- _descriptor.FieldDescriptor(
45
- name='description', full_name='clarifai.api.status.Status.description', index=1,
46
- number=2, type=9, cpp_type=9, label=1,
47
- has_default_value=False, default_value=b"".decode('utf-8'),
48
- message_type=None, enum_type=None, containing_type=None,
49
- is_extension=False, extension_scope=None,
50
- serialized_options=None, file=DESCRIPTOR),
51
- _descriptor.FieldDescriptor(
52
- name='details', full_name='clarifai.api.status.Status.details', index=2,
53
- number=3, type=9, cpp_type=9, label=1,
54
- has_default_value=False, default_value=b"".decode('utf-8'),
55
- message_type=None, enum_type=None, containing_type=None,
56
- is_extension=False, extension_scope=None,
57
- serialized_options=None, file=DESCRIPTOR),
58
- _descriptor.FieldDescriptor(
59
- name='stack_trace', full_name='clarifai.api.status.Status.stack_trace', index=3,
60
- number=4, type=9, cpp_type=9, label=3,
61
- has_default_value=False, default_value=[],
62
- message_type=None, enum_type=None, containing_type=None,
63
- is_extension=False, extension_scope=None,
64
- serialized_options=b'\200\234\'\001', file=DESCRIPTOR),
65
- _descriptor.FieldDescriptor(
66
- name='percent_completed', full_name='clarifai.api.status.Status.percent_completed', index=4,
67
- number=5, type=13, cpp_type=3, label=1,
68
- has_default_value=False, default_value=0,
69
- message_type=None, enum_type=None, containing_type=None,
70
- is_extension=False, extension_scope=None,
71
- serialized_options=None, file=DESCRIPTOR),
72
- _descriptor.FieldDescriptor(
73
- name='time_remaining', full_name='clarifai.api.status.Status.time_remaining', index=5,
74
- number=6, type=13, cpp_type=3, label=1,
75
- has_default_value=False, default_value=0,
76
- message_type=None, enum_type=None, containing_type=None,
77
- is_extension=False, extension_scope=None,
78
- serialized_options=None, file=DESCRIPTOR),
79
- _descriptor.FieldDescriptor(
80
- name='req_id', full_name='clarifai.api.status.Status.req_id', index=6,
81
- number=7, type=9, cpp_type=9, label=1,
82
- has_default_value=False, default_value=b"".decode('utf-8'),
83
- message_type=None, enum_type=None, containing_type=None,
84
- is_extension=False, extension_scope=None,
85
- serialized_options=None, file=DESCRIPTOR),
86
- _descriptor.FieldDescriptor(
87
- name='internal_details', full_name='clarifai.api.status.Status.internal_details', index=7,
88
- number=8, type=9, cpp_type=9, label=1,
89
- has_default_value=False, default_value=b"".decode('utf-8'),
90
- message_type=None, enum_type=None, containing_type=None,
91
- is_extension=False, extension_scope=None,
92
- serialized_options=b'\200\234\'\001', file=DESCRIPTOR),
93
- ],
94
- extensions=[
95
- ],
96
- nested_types=[],
97
- enum_types=[
98
- ],
99
- serialized_options=None,
100
- is_extendable=False,
101
- syntax='proto3',
102
- extension_ranges=[],
103
- oneofs=[
104
- ],
105
- serialized_start=151,
106
- serialized_end=370,
107
- )
108
-
109
-
110
- _BASERESPONSE = _descriptor.Descriptor(
111
- name='BaseResponse',
112
- full_name='clarifai.api.status.BaseResponse',
113
- filename=None,
114
- file=DESCRIPTOR,
115
- containing_type=None,
116
- fields=[
117
- _descriptor.FieldDescriptor(
118
- name='status', full_name='clarifai.api.status.BaseResponse.status', index=0,
119
- number=1, type=11, cpp_type=10, label=1,
120
- has_default_value=False, default_value=None,
121
- message_type=None, enum_type=None, containing_type=None,
122
- is_extension=False, extension_scope=None,
123
- serialized_options=None, file=DESCRIPTOR),
124
- ],
125
- extensions=[
126
- ],
127
- nested_types=[],
128
- enum_types=[
129
- ],
130
- serialized_options=None,
131
- is_extendable=False,
132
- syntax='proto3',
133
- extension_ranges=[],
134
- oneofs=[
135
- ],
136
- serialized_start=372,
137
- serialized_end=431,
138
- )
139
-
140
- _STATUS.fields_by_name['code'].enum_type = proto_dot_clarifai_dot_api_dot_status_dot_status__code__pb2._STATUSCODE
141
- _BASERESPONSE.fields_by_name['status'].message_type = _STATUS
142
- DESCRIPTOR.message_types_by_name['Status'] = _STATUS
143
- DESCRIPTOR.message_types_by_name['BaseResponse'] = _BASERESPONSE
144
- _sym_db.RegisterFileDescriptor(DESCRIPTOR)
145
-
146
- Status = _reflection.GeneratedProtocolMessageType('Status', (_message.Message,), {
147
- 'DESCRIPTOR' : _STATUS,
148
- '__module__' : 'proto.clarifai.api.status.status_pb2'
149
- # @@protoc_insertion_point(class_scope:clarifai.api.status.Status)
150
- })
151
- _sym_db.RegisterMessage(Status)
152
-
153
- BaseResponse = _reflection.GeneratedProtocolMessageType('BaseResponse', (_message.Message,), {
154
- 'DESCRIPTOR' : _BASERESPONSE,
155
- '__module__' : 'proto.clarifai.api.status.status_pb2'
156
- # @@protoc_insertion_point(class_scope:clarifai.api.status.BaseResponse)
157
- })
158
- _sym_db.RegisterMessage(BaseResponse)
159
-
160
-
161
- DESCRIPTOR._options = None
162
- _STATUS.fields_by_name['stack_trace']._options = None
163
- _STATUS.fields_by_name['internal_details']._options = None
18
+ DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n&proto/clarifai/api/status/status.proto\x12\x13\x63larifai.api.status\x1a(proto/clarifai/auth/util/extension.proto\x1a+proto/clarifai/api/status/status_code.proto\"\xb4\x02\n\x06Status\x12-\n\x04\x63ode\x18\x01 \x01(\x0e\x32\x1f.clarifai.api.status.StatusCode\x12\x13\n\x0b\x64\x65scription\x18\x02 \x01(\t\x12\x0f\n\x07\x64\x65tails\x18\x03 \x01(\t\x12\x19\n\x0bstack_trace\x18\x04 \x03(\tB\x04\x80\x9c\'\x01\x12\x19\n\x11percent_completed\x18\x05 \x01(\r\x12\x16\n\x0etime_remaining\x18\x06 \x01(\r\x12\x0e\n\x06req_id\x18\x07 \x01(\t\x12\x1e\n\x10internal_details\x18\x08 \x01(\tB\x04\x80\x9c\'\x01\x12>\n\rredirect_info\x18\t \x01(\x0b\x32!.clarifai.api.status.RedirectInfoB\x04\x80\x9c\'\x01\x12\x17\n\x0f\x64\x65veloper_notes\x18\n \x01(\t\"d\n\x0cRedirectInfo\x12\x0b\n\x03url\x18\x01 \x01(\t\x12\x15\n\rresource_type\x18\x02 \x01(\t\x12\x17\n\x0fold_resource_id\x18\x03 \x01(\t\x12\x17\n\x0fnew_resource_id\x18\x04 \x01(\t\";\n\x0c\x42\x61seResponse\x12+\n\x06status\x18\x01 \x01(\x0b\x32\x1b.clarifai.api.status.StatusBg\n\x1c\x63om.clarifai.grpc.api.statusP\x01Z>github.com/Clarifai/clarifai-go-grpc/proto/clarifai/api/status\xa2\x02\x04\x43\x41IPb\x06proto3')
19
+
20
+ _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals())
21
+ _builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'proto.clarifai.api.status.status_pb2', globals())
22
+ if _descriptor._USE_C_DESCRIPTORS == False:
23
+
24
+ DESCRIPTOR._options = None
25
+ DESCRIPTOR._serialized_options = b'\n\034com.clarifai.grpc.api.statusP\001Z>github.com/Clarifai/clarifai-go-grpc/proto/clarifai/api/status\242\002\004CAIP'
26
+ _STATUS.fields_by_name['stack_trace']._options = None
27
+ _STATUS.fields_by_name['stack_trace']._serialized_options = b'\200\234\'\001'
28
+ _STATUS.fields_by_name['internal_details']._options = None
29
+ _STATUS.fields_by_name['internal_details']._serialized_options = b'\200\234\'\001'
30
+ _STATUS.fields_by_name['redirect_info']._options = None
31
+ _STATUS.fields_by_name['redirect_info']._serialized_options = b'\200\234\'\001'
32
+ _STATUS._serialized_start=151
33
+ _STATUS._serialized_end=459
34
+ _REDIRECTINFO._serialized_start=461
35
+ _REDIRECTINFO._serialized_end=561
36
+ _BASERESPONSE._serialized_start=563
37
+ _BASERESPONSE._serialized_end=622
164
38
  # @@protoc_insertion_point(module_scope)
@@ -0,0 +1,174 @@
1
+ """
2
+ @generated by mypy-protobuf. Do not edit manually!
3
+ isort:skip_file
4
+ """
5
+
6
+ import builtins
7
+ import collections.abc
8
+ import sys
9
+
10
+ import google.protobuf.descriptor
11
+ import google.protobuf.internal.containers
12
+ import google.protobuf.message
13
+ import proto.clarifai.api.status.status_code_pb2
14
+
15
+ if sys.version_info >= (3, 8):
16
+ import typing as typing_extensions
17
+ else:
18
+ import typing_extensions
19
+
20
+ DESCRIPTOR: google.protobuf.descriptor.FileDescriptor
21
+
22
+ @typing_extensions.final
23
+ class Status(google.protobuf.message.Message):
24
+ DESCRIPTOR: google.protobuf.descriptor.Descriptor
25
+
26
+ CODE_FIELD_NUMBER: builtins.int
27
+ DESCRIPTION_FIELD_NUMBER: builtins.int
28
+ DETAILS_FIELD_NUMBER: builtins.int
29
+ STACK_TRACE_FIELD_NUMBER: builtins.int
30
+ PERCENT_COMPLETED_FIELD_NUMBER: builtins.int
31
+ TIME_REMAINING_FIELD_NUMBER: builtins.int
32
+ REQ_ID_FIELD_NUMBER: builtins.int
33
+ INTERNAL_DETAILS_FIELD_NUMBER: builtins.int
34
+ REDIRECT_INFO_FIELD_NUMBER: builtins.int
35
+ DEVELOPER_NOTES_FIELD_NUMBER: builtins.int
36
+ code: proto.clarifai.api.status.status_code_pb2.StatusCode.ValueType
37
+ """Status code from internal codes."""
38
+ description: builtins.str
39
+ """A short description of the error."""
40
+ details: builtins.str
41
+ """More details of the given error.
42
+ These details may be exposed to non-technical users.
43
+ For technical details, try to use developer_notes field.
44
+ """
45
+ @property
46
+ def stack_trace(
47
+ self,
48
+ ) -> google.protobuf.internal.containers.RepeatedScalarFieldContainer[builtins.str]:
49
+ """For some environment we may return a stack trace to help debug
50
+ any issues.
51
+ """
52
+ percent_completed: builtins.int
53
+ """specifically for long running jobs"""
54
+ time_remaining: builtins.int
55
+ """if status is pending, how much time is remaining (in seconds)"""
56
+ req_id: builtins.str
57
+ """A request ID may be present, to help monitoring and tracking requests"""
58
+ internal_details: builtins.str
59
+ """Internal Annotation (do not set in production, for internal Clarifai use only)."""
60
+ @property
61
+ def redirect_info(self) -> global___RedirectInfo:
62
+ """Resource location info for redirect, when resource location has been changed."""
63
+ developer_notes: builtins.str
64
+ """Notes for developer.
65
+ These notes are rather technical details for developers how to interpret the status,
66
+ e.g. why an error occurred and how to avoid getting the error.
67
+ """
68
+ def __init__(
69
+ self,
70
+ *,
71
+ code: proto.clarifai.api.status.status_code_pb2.StatusCode.ValueType = ...,
72
+ description: builtins.str = ...,
73
+ details: builtins.str = ...,
74
+ stack_trace: collections.abc.Iterable[builtins.str] | None = ...,
75
+ percent_completed: builtins.int = ...,
76
+ time_remaining: builtins.int = ...,
77
+ req_id: builtins.str = ...,
78
+ internal_details: builtins.str = ...,
79
+ redirect_info: global___RedirectInfo | None = ...,
80
+ developer_notes: builtins.str = ...,
81
+ ) -> None: ...
82
+ def HasField(
83
+ self, field_name: typing_extensions.Literal["redirect_info", b"redirect_info"]
84
+ ) -> builtins.bool: ...
85
+ def ClearField(
86
+ self,
87
+ field_name: typing_extensions.Literal[
88
+ "code",
89
+ b"code",
90
+ "description",
91
+ b"description",
92
+ "details",
93
+ b"details",
94
+ "developer_notes",
95
+ b"developer_notes",
96
+ "internal_details",
97
+ b"internal_details",
98
+ "percent_completed",
99
+ b"percent_completed",
100
+ "redirect_info",
101
+ b"redirect_info",
102
+ "req_id",
103
+ b"req_id",
104
+ "stack_trace",
105
+ b"stack_trace",
106
+ "time_remaining",
107
+ b"time_remaining",
108
+ ],
109
+ ) -> None: ...
110
+
111
+ global___Status = Status
112
+
113
+ @typing_extensions.final
114
+ class RedirectInfo(google.protobuf.message.Message):
115
+ DESCRIPTOR: google.protobuf.descriptor.Descriptor
116
+
117
+ URL_FIELD_NUMBER: builtins.int
118
+ RESOURCE_TYPE_FIELD_NUMBER: builtins.int
119
+ OLD_RESOURCE_ID_FIELD_NUMBER: builtins.int
120
+ NEW_RESOURCE_ID_FIELD_NUMBER: builtins.int
121
+ url: builtins.str
122
+ """New location for the resource. Used to set response Location header."""
123
+ resource_type: builtins.str
124
+ """Resource type"""
125
+ old_resource_id: builtins.str
126
+ """Old resource id"""
127
+ new_resource_id: builtins.str
128
+ """New resource id"""
129
+ def __init__(
130
+ self,
131
+ *,
132
+ url: builtins.str = ...,
133
+ resource_type: builtins.str = ...,
134
+ old_resource_id: builtins.str = ...,
135
+ new_resource_id: builtins.str = ...,
136
+ ) -> None: ...
137
+ def ClearField(
138
+ self,
139
+ field_name: typing_extensions.Literal[
140
+ "new_resource_id",
141
+ b"new_resource_id",
142
+ "old_resource_id",
143
+ b"old_resource_id",
144
+ "resource_type",
145
+ b"resource_type",
146
+ "url",
147
+ b"url",
148
+ ],
149
+ ) -> None: ...
150
+
151
+ global___RedirectInfo = RedirectInfo
152
+
153
+ @typing_extensions.final
154
+ class BaseResponse(google.protobuf.message.Message):
155
+ """Base message to return when there is a internal server error that
156
+ is not caught elsewhere.
157
+ """
158
+
159
+ DESCRIPTOR: google.protobuf.descriptor.Descriptor
160
+
161
+ STATUS_FIELD_NUMBER: builtins.int
162
+ @property
163
+ def status(self) -> global___Status: ...
164
+ def __init__(
165
+ self,
166
+ *,
167
+ status: global___Status | None = ...,
168
+ ) -> None: ...
169
+ def HasField(
170
+ self, field_name: typing_extensions.Literal["status", b"status"]
171
+ ) -> builtins.bool: ...
172
+ def ClearField(self, field_name: typing_extensions.Literal["status", b"status"]) -> None: ...
173
+
174
+ global___BaseResponse = BaseResponse
@@ -1,3 +1,4 @@
1
1
  # Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
2
+ """Client and server classes corresponding to protobuf-defined services."""
2
3
  import grpc
3
4
 
@@ -1,10 +1,10 @@
1
1
  # -*- coding: utf-8 -*-
2
2
  # Generated by the protocol buffer compiler. DO NOT EDIT!
3
3
  # source: proto/clarifai/api/utils/extensions.proto
4
-
4
+ """Generated protocol buffer code."""
5
+ from google.protobuf.internal import builder as _builder
5
6
  from google.protobuf import descriptor as _descriptor
6
- from google.protobuf import message as _message
7
- from google.protobuf import reflection as _reflection
7
+ from google.protobuf import descriptor_pool as _descriptor_pool
8
8
  from google.protobuf import symbol_database as _symbol_database
9
9
  # @@protoc_insertion_point(imports)
10
10
 
@@ -14,49 +14,16 @@ _sym_db = _symbol_database.Default()
14
14
  from google.protobuf import descriptor_pb2 as google_dot_protobuf_dot_descriptor__pb2
15
15
 
16
16
 
17
- DESCRIPTOR = _descriptor.FileDescriptor(
18
- name='proto/clarifai/api/utils/extensions.proto',
19
- package='clarifai.api.utils',
20
- syntax='proto3',
21
- serialized_options=b'\n\033com.clarifai.grpc.api.utilsP\001Z\005utils\242\002\004CAIP',
22
- serialized_pb=b'\n)proto/clarifai/api/utils/extensions.proto\x12\x12\x63larifai.api.utils\x1a google/protobuf/descriptor.proto:9\n\x10\x63l_show_if_empty\x12\x1d.google.protobuf.FieldOptions\x18\xd0\x86\x03 \x01(\x08:4\n\x0b\x63l_moretags\x12\x1d.google.protobuf.FieldOptions\x18\xd1\x86\x03 \x01(\t:9\n\x10\x63l_default_float\x12\x1d.google.protobuf.FieldOptions\x18\xda\x86\x03 \x01(\x02\x42-\n\x1b\x63om.clarifai.grpc.api.utilsP\x01Z\x05utils\xa2\x02\x04\x43\x41IPb\x06proto3'
23
- ,
24
- dependencies=[google_dot_protobuf_dot_descriptor__pb2.DESCRIPTOR,])
25
-
26
-
27
- CL_SHOW_IF_EMPTY_FIELD_NUMBER = 50000
28
- cl_show_if_empty = _descriptor.FieldDescriptor(
29
- name='cl_show_if_empty', full_name='clarifai.api.utils.cl_show_if_empty', index=0,
30
- number=50000, type=8, cpp_type=7, label=1,
31
- has_default_value=False, default_value=False,
32
- message_type=None, enum_type=None, containing_type=None,
33
- is_extension=True, extension_scope=None,
34
- serialized_options=None, file=DESCRIPTOR)
35
- CL_MORETAGS_FIELD_NUMBER = 50001
36
- cl_moretags = _descriptor.FieldDescriptor(
37
- name='cl_moretags', full_name='clarifai.api.utils.cl_moretags', index=1,
38
- number=50001, type=9, cpp_type=9, label=1,
39
- has_default_value=False, default_value=b"".decode('utf-8'),
40
- message_type=None, enum_type=None, containing_type=None,
41
- is_extension=True, extension_scope=None,
42
- serialized_options=None, file=DESCRIPTOR)
43
- CL_DEFAULT_FLOAT_FIELD_NUMBER = 50010
44
- cl_default_float = _descriptor.FieldDescriptor(
45
- name='cl_default_float', full_name='clarifai.api.utils.cl_default_float', index=2,
46
- number=50010, type=2, cpp_type=6, label=1,
47
- has_default_value=False, default_value=float(0),
48
- message_type=None, enum_type=None, containing_type=None,
49
- is_extension=True, extension_scope=None,
50
- serialized_options=None, file=DESCRIPTOR)
51
-
52
- DESCRIPTOR.extensions_by_name['cl_show_if_empty'] = cl_show_if_empty
53
- DESCRIPTOR.extensions_by_name['cl_moretags'] = cl_moretags
54
- DESCRIPTOR.extensions_by_name['cl_default_float'] = cl_default_float
55
- _sym_db.RegisterFileDescriptor(DESCRIPTOR)
17
+ DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n)proto/clarifai/api/utils/extensions.proto\x12\x12\x63larifai.api.utils\x1a google/protobuf/descriptor.proto:9\n\x10\x63l_show_if_empty\x12\x1d.google.protobuf.FieldOptions\x18\xd0\x86\x03 \x01(\x08:4\n\x0b\x63l_moretags\x12\x1d.google.protobuf.FieldOptions\x18\xd1\x86\x03 \x01(\t:9\n\x10\x63l_default_float\x12\x1d.google.protobuf.FieldOptions\x18\xda\x86\x03 \x01(\x02:7\n\x0b\x64\x65scription\x12!.google.protobuf.EnumValueOptions\x18\xe8\x07 \x01(\tBe\n\x1b\x63om.clarifai.grpc.api.utilsP\x01Z=github.com/Clarifai/clarifai-go-grpc/proto/clarifai/api/utils\xa2\x02\x04\x43\x41IPb\x06proto3')
56
18
 
57
- google_dot_protobuf_dot_descriptor__pb2.FieldOptions.RegisterExtension(cl_show_if_empty)
58
- google_dot_protobuf_dot_descriptor__pb2.FieldOptions.RegisterExtension(cl_moretags)
59
- google_dot_protobuf_dot_descriptor__pb2.FieldOptions.RegisterExtension(cl_default_float)
19
+ _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals())
20
+ _builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'proto.clarifai.api.utils.extensions_pb2', globals())
21
+ if _descriptor._USE_C_DESCRIPTORS == False:
22
+ google_dot_protobuf_dot_descriptor__pb2.FieldOptions.RegisterExtension(cl_show_if_empty)
23
+ google_dot_protobuf_dot_descriptor__pb2.FieldOptions.RegisterExtension(cl_moretags)
24
+ google_dot_protobuf_dot_descriptor__pb2.FieldOptions.RegisterExtension(cl_default_float)
25
+ google_dot_protobuf_dot_descriptor__pb2.EnumValueOptions.RegisterExtension(description)
60
26
 
61
- DESCRIPTOR._options = None
27
+ DESCRIPTOR._options = None
28
+ DESCRIPTOR._serialized_options = b'\n\033com.clarifai.grpc.api.utilsP\001Z=github.com/Clarifai/clarifai-go-grpc/proto/clarifai/api/utils\242\002\004CAIP'
62
29
  # @@protoc_insertion_point(module_scope)
@@ -0,0 +1,39 @@
1
+ """
2
+ @generated by mypy-protobuf. Do not edit manually!
3
+ isort:skip_file
4
+ """
5
+
6
+ import builtins
7
+
8
+ import google.protobuf.descriptor
9
+ import google.protobuf.descriptor_pb2
10
+ import google.protobuf.internal.extension_dict
11
+
12
+ DESCRIPTOR: google.protobuf.descriptor.FileDescriptor
13
+
14
+ CL_SHOW_IF_EMPTY_FIELD_NUMBER: builtins.int
15
+ CL_MORETAGS_FIELD_NUMBER: builtins.int
16
+ CL_DEFAULT_FLOAT_FIELD_NUMBER: builtins.int
17
+ DESCRIPTION_FIELD_NUMBER: builtins.int
18
+ cl_show_if_empty: google.protobuf.internal.extension_dict._ExtensionFieldDescriptor[
19
+ google.protobuf.descriptor_pb2.FieldOptions, builtins.bool
20
+ ]
21
+ """If True then we will return this field with it's zero value even if not set.
22
+ This means in json responses empty lists will appear instead of not being returned (which is
23
+ the default convention for proto3). For int's we will show 0, for floats 0.0, etc.
24
+ """
25
+ cl_moretags: google.protobuf.internal.extension_dict._ExtensionFieldDescriptor[
26
+ google.protobuf.descriptor_pb2.FieldOptions, builtins.str
27
+ ]
28
+ cl_default_float: google.protobuf.internal.extension_dict._ExtensionFieldDescriptor[
29
+ google.protobuf.descriptor_pb2.FieldOptions, builtins.float
30
+ ]
31
+ """For float fields where this is set, this value will be used by the server when parsing the
32
+ request and the field is not present in the request. If the field is present in the request,
33
+ then the value of the field will be used instead. This is ONLY used for json requests as binary
34
+ proto requests are expected to always set the field.
35
+ """
36
+ description: google.protobuf.internal.extension_dict._ExtensionFieldDescriptor[
37
+ google.protobuf.descriptor_pb2.EnumValueOptions, builtins.str
38
+ ]
39
+ """A description of the enum value."""
@@ -1,3 +1,4 @@
1
1
  # Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
2
+ """Client and server classes corresponding to protobuf-defined services."""
2
3
  import grpc
3
4
 
@@ -0,0 +1,26 @@
1
+ # -*- coding: utf-8 -*-
2
+ # Generated by the protocol buffer compiler. DO NOT EDIT!
3
+ # source: proto/clarifai/api/utils/matrix.proto
4
+ """Generated protocol buffer code."""
5
+ from google.protobuf.internal import builder as _builder
6
+ from google.protobuf import descriptor as _descriptor
7
+ from google.protobuf import descriptor_pool as _descriptor_pool
8
+ from google.protobuf import symbol_database as _symbol_database
9
+ # @@protoc_insertion_point(imports)
10
+
11
+ _sym_db = _symbol_database.Default()
12
+
13
+
14
+
15
+
16
+ DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n%proto/clarifai/api/utils/matrix.proto\",\n\x0cMatrixUint64\x12\x0e\n\x06n_cols\x18\x01 \x01(\x04\x12\x0c\n\x04\x64\x61ta\x18\x02 \x03(\x04\x42\\\n\x1b\x63om.clarifai.grpc.api.utilsZ=github.com/Clarifai/clarifai-go-grpc/proto/clarifai/api/utilsb\x06proto3')
17
+
18
+ _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals())
19
+ _builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'proto.clarifai.api.utils.matrix_pb2', globals())
20
+ if _descriptor._USE_C_DESCRIPTORS == False:
21
+
22
+ DESCRIPTOR._options = None
23
+ DESCRIPTOR._serialized_options = b'\n\033com.clarifai.grpc.api.utilsZ=github.com/Clarifai/clarifai-go-grpc/proto/clarifai/api/utils'
24
+ _MATRIXUINT64._serialized_start=41
25
+ _MATRIXUINT64._serialized_end=85
26
+ # @@protoc_insertion_point(module_scope)
@@ -0,0 +1,53 @@
1
+ """
2
+ @generated by mypy-protobuf. Do not edit manually!
3
+ isort:skip_file
4
+ """
5
+
6
+ import builtins
7
+ import collections.abc
8
+ import sys
9
+
10
+ import google.protobuf.descriptor
11
+ import google.protobuf.internal.containers
12
+ import google.protobuf.message
13
+
14
+ if sys.version_info >= (3, 8):
15
+ import typing as typing_extensions
16
+ else:
17
+ import typing_extensions
18
+
19
+ DESCRIPTOR: google.protobuf.descriptor.FileDescriptor
20
+
21
+ @typing_extensions.final
22
+ class MatrixUint64(google.protobuf.message.Message):
23
+ """Store matrix of uint64s values.
24
+ It is recommended to store the matrix as a 1D array
25
+ because it produces less bytes during serialization than a 2D array.
26
+ The matrix does store the number of columns, but it does not store the number of rows.
27
+ The number of rows can automatically be calculated as length(data)/n_cols.
28
+ """
29
+
30
+ DESCRIPTOR: google.protobuf.descriptor.Descriptor
31
+
32
+ N_COLS_FIELD_NUMBER: builtins.int
33
+ DATA_FIELD_NUMBER: builtins.int
34
+ n_cols: builtins.int
35
+ """Number of columns"""
36
+ @property
37
+ def data(
38
+ self,
39
+ ) -> google.protobuf.internal.containers.RepeatedScalarFieldContainer[builtins.int]:
40
+ """Matrix data stored as an array.
41
+ In order to access matrix element at row i & column j, use data[i*n_cols+j].
42
+ """
43
+ def __init__(
44
+ self,
45
+ *,
46
+ n_cols: builtins.int = ...,
47
+ data: collections.abc.Iterable[builtins.int] | None = ...,
48
+ ) -> None: ...
49
+ def ClearField(
50
+ self, field_name: typing_extensions.Literal["data", b"data", "n_cols", b"n_cols"]
51
+ ) -> None: ...
52
+
53
+ global___MatrixUint64 = MatrixUint64
@@ -0,0 +1,4 @@
1
+ # Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
2
+ """Client and server classes corresponding to protobuf-defined services."""
3
+ import grpc
4
+