Skip to content

Commit e790792

Browse files
committed
feat(gooddata-sdk): [AUTO] Add Anthropic provider config to LLM provider config
1 parent 38b0798 commit e790792

8 files changed

Lines changed: 1312 additions & 0 deletions

File tree

check_import.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
print("import OK")
Lines changed: 332 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,332 @@
1+
"""
2+
OpenAPI definition
3+
4+
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501
5+
6+
The version of the OpenAPI document: v0
7+
Contact: support@gooddata.com
8+
Generated by: https://openapi-generator.tech
9+
"""
10+
11+
12+
import re # noqa: F401
13+
import sys # noqa: F401
14+
15+
from gooddata_api_client.model_utils import ( # noqa: F401
16+
ApiTypeError,
17+
ModelComposed,
18+
ModelNormal,
19+
ModelSimple,
20+
cached_property,
21+
change_keys_js_to_python,
22+
convert_js_args_to_python_args,
23+
date,
24+
datetime,
25+
file_type,
26+
none_type,
27+
validate_get_composed_info,
28+
OpenApiModel
29+
)
30+
from gooddata_api_client.exceptions import ApiAttributeError
31+
32+
33+
def lazy_import():
34+
from gooddata_api_client.model.anthropic_api_key_auth_all_of import AnthropicApiKeyAuthAllOf
35+
globals()['AnthropicApiKeyAuthAllOf'] = AnthropicApiKeyAuthAllOf
36+
37+
38+
class AnthropicApiKeyAuth(ModelComposed):
39+
"""NOTE: This class is auto generated by OpenAPI Generator.
40+
Ref: https://openapi-generator.tech
41+
42+
Do not edit the class manually.
43+
44+
Attributes:
45+
allowed_values (dict): The key is the tuple path to the attribute
46+
and the for var_name this is (var_name,). The value is a dict
47+
with a capitalized key describing the allowed value and an allowed
48+
value. These dicts store the allowed enum values.
49+
attribute_map (dict): The key is attribute name
50+
and the value is json key in definition.
51+
discriminator_value_class_map (dict): A dict to go from the discriminator
52+
variable value to the discriminator class name.
53+
validations (dict): The key is the tuple path to the attribute
54+
and the for var_name this is (var_name,). The value is a dict
55+
that stores validations for max_length, min_length, max_items,
56+
min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum,
57+
inclusive_minimum, and regex.
58+
additional_properties_type (tuple): A tuple of classes accepted
59+
as additional properties values.
60+
"""
61+
62+
allowed_values = {
63+
('type',): {
64+
'API_KEY': "API_KEY",
65+
},
66+
}
67+
68+
validations = {
69+
('api_key',): {
70+
'max_length': 255,
71+
},
72+
}
73+
74+
@cached_property
75+
def additional_properties_type():
76+
"""
77+
This must be a method because a model may have properties that are
78+
of type self, this must run after the class is loaded
79+
"""
80+
lazy_import()
81+
return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501
82+
83+
_nullable = False
84+
85+
@cached_property
86+
def openapi_types():
87+
"""
88+
This must be a method because a model may have properties that are
89+
of type self, this must run after the class is loaded
90+
91+
Returns
92+
openapi_types (dict): The key is attribute name
93+
and the value is attribute type.
94+
"""
95+
lazy_import()
96+
return {
97+
'type': (str,), # noqa: E501
98+
'api_key': (str, none_type,), # noqa: E501
99+
}
100+
101+
@cached_property
102+
def discriminator():
103+
return None
104+
105+
106+
attribute_map = {
107+
'type': 'type', # noqa: E501
108+
'api_key': 'apiKey', # noqa: E501
109+
}
110+
111+
read_only_vars = {
112+
}
113+
114+
@classmethod
115+
@convert_js_args_to_python_args
116+
def _from_openapi_data(cls, *args, **kwargs): # noqa: E501
117+
"""AnthropicApiKeyAuth - a model defined in OpenAPI
118+
119+
Keyword Args:
120+
type (str): Authentication type.. defaults to "API_KEY", must be one of ["API_KEY", ] # noqa: E501
121+
_check_type (bool): if True, values for parameters in openapi_types
122+
will be type checked and a TypeError will be
123+
raised if the wrong type is input.
124+
Defaults to True
125+
_path_to_item (tuple/list): This is a list of keys or values to
126+
drill down to the model in received_data
127+
when deserializing a response
128+
_spec_property_naming (bool): True if the variable names in the input data
129+
are serialized names, as specified in the OpenAPI document.
130+
False if the variable names in the input data
131+
are pythonic names, e.g. snake case (default)
132+
_configuration (Configuration): the instance to use when
133+
deserializing a file_type parameter.
134+
If passed, type conversion is attempted
135+
If omitted no type conversion is done.
136+
_visited_composed_classes (tuple): This stores a tuple of
137+
classes that we have traveled through so that
138+
if we see that class again we will not use its
139+
discriminator again.
140+
When traveling through a discriminator, the
141+
composed schema that is
142+
is traveled through is added to this set.
143+
For example if Animal has a discriminator
144+
petType and we pass in "Dog", and the class Dog
145+
allOf includes Animal, we move through Animal
146+
once using the discriminator, and pick Dog.
147+
Then in Dog, we will make an instance of the
148+
Animal class but this time we won't travel
149+
through its discriminator because we passed in
150+
_visited_composed_classes = (Animal,)
151+
api_key (str, none_type): Anthropic API key.. [optional] # noqa: E501
152+
"""
153+
154+
type = kwargs.get('type', "API_KEY")
155+
_check_type = kwargs.pop('_check_type', True)
156+
_spec_property_naming = kwargs.pop('_spec_property_naming', False)
157+
_path_to_item = kwargs.pop('_path_to_item', ())
158+
_configuration = kwargs.pop('_configuration', None)
159+
_visited_composed_classes = kwargs.pop('_visited_composed_classes', ())
160+
161+
self = super(OpenApiModel, cls).__new__(cls)
162+
163+
if args:
164+
for arg in args:
165+
if isinstance(arg, dict):
166+
kwargs.update(arg)
167+
else:
168+
raise ApiTypeError(
169+
"Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % (
170+
args,
171+
self.__class__.__name__,
172+
),
173+
path_to_item=_path_to_item,
174+
valid_classes=(self.__class__,),
175+
)
176+
177+
self._data_store = {}
178+
self._check_type = _check_type
179+
self._spec_property_naming = _spec_property_naming
180+
self._path_to_item = _path_to_item
181+
self._configuration = _configuration
182+
self._visited_composed_classes = _visited_composed_classes + (self.__class__,)
183+
184+
constant_args = {
185+
'_check_type': _check_type,
186+
'_path_to_item': _path_to_item,
187+
'_spec_property_naming': _spec_property_naming,
188+
'_configuration': _configuration,
189+
'_visited_composed_classes': self._visited_composed_classes,
190+
}
191+
composed_info = validate_get_composed_info(
192+
constant_args, kwargs, self)
193+
self._composed_instances = composed_info[0]
194+
self._var_name_to_model_instances = composed_info[1]
195+
self._additional_properties_model_instances = composed_info[2]
196+
discarded_args = composed_info[3]
197+
198+
for var_name, var_value in kwargs.items():
199+
if var_name in discarded_args and \
200+
self._configuration is not None and \
201+
self._configuration.discard_unknown_keys and \
202+
self._additional_properties_model_instances:
203+
# discard variable.
204+
continue
205+
setattr(self, var_name, var_value)
206+
207+
return self
208+
209+
required_properties = set([
210+
'_data_store',
211+
'_check_type',
212+
'_spec_property_naming',
213+
'_path_to_item',
214+
'_configuration',
215+
'_visited_composed_classes',
216+
'_composed_instances',
217+
'_var_name_to_model_instances',
218+
'_additional_properties_model_instances',
219+
])
220+
221+
@convert_js_args_to_python_args
222+
def __init__(self, *args, **kwargs): # noqa: E501
223+
"""AnthropicApiKeyAuth - a model defined in OpenAPI
224+
225+
Keyword Args:
226+
type (str): Authentication type.. defaults to "API_KEY", must be one of ["API_KEY", ] # noqa: E501
227+
_check_type (bool): if True, values for parameters in openapi_types
228+
will be type checked and a TypeError will be
229+
raised if the wrong type is input.
230+
Defaults to True
231+
_path_to_item (tuple/list): This is a list of keys or values to
232+
drill down to the model in received_data
233+
when deserializing a response
234+
_spec_property_naming (bool): True if the variable names in the input data
235+
are serialized names, as specified in the OpenAPI document.
236+
False if the variable names in the input data
237+
are pythonic names, e.g. snake case (default)
238+
_configuration (Configuration): the instance to use when
239+
deserializing a file_type parameter.
240+
If passed, type conversion is attempted
241+
If omitted no type conversion is done.
242+
_visited_composed_classes (tuple): This stores a tuple of
243+
classes that we have traveled through so that
244+
if we see that class again we will not use its
245+
discriminator again.
246+
When traveling through a discriminator, the
247+
composed schema that is
248+
is traveled through is added to this set.
249+
For example if Animal has a discriminator
250+
petType and we pass in "Dog", and the class Dog
251+
allOf includes Animal, we move through Animal
252+
once using the discriminator, and pick Dog.
253+
Then in Dog, we will make an instance of the
254+
Animal class but this time we won't travel
255+
through its discriminator because we passed in
256+
_visited_composed_classes = (Animal,)
257+
api_key (str, none_type): Anthropic API key.. [optional] # noqa: E501
258+
"""
259+
260+
type = kwargs.get('type', "API_KEY")
261+
_check_type = kwargs.pop('_check_type', True)
262+
_spec_property_naming = kwargs.pop('_spec_property_naming', False)
263+
_path_to_item = kwargs.pop('_path_to_item', ())
264+
_configuration = kwargs.pop('_configuration', None)
265+
_visited_composed_classes = kwargs.pop('_visited_composed_classes', ())
266+
267+
if args:
268+
for arg in args:
269+
if isinstance(arg, dict):
270+
kwargs.update(arg)
271+
else:
272+
raise ApiTypeError(
273+
"Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % (
274+
args,
275+
self.__class__.__name__,
276+
),
277+
path_to_item=_path_to_item,
278+
valid_classes=(self.__class__,),
279+
)
280+
281+
self._data_store = {}
282+
self._check_type = _check_type
283+
self._spec_property_naming = _spec_property_naming
284+
self._path_to_item = _path_to_item
285+
self._configuration = _configuration
286+
self._visited_composed_classes = _visited_composed_classes + (self.__class__,)
287+
288+
constant_args = {
289+
'_check_type': _check_type,
290+
'_path_to_item': _path_to_item,
291+
'_spec_property_naming': _spec_property_naming,
292+
'_configuration': _configuration,
293+
'_visited_composed_classes': self._visited_composed_classes,
294+
}
295+
composed_info = validate_get_composed_info(
296+
constant_args, kwargs, self)
297+
self._composed_instances = composed_info[0]
298+
self._var_name_to_model_instances = composed_info[1]
299+
self._additional_properties_model_instances = composed_info[2]
300+
discarded_args = composed_info[3]
301+
302+
for var_name, var_value in kwargs.items():
303+
if var_name in discarded_args and \
304+
self._configuration is not None and \
305+
self._configuration.discard_unknown_keys and \
306+
self._additional_properties_model_instances:
307+
# discard variable.
308+
continue
309+
setattr(self, var_name, var_value)
310+
if var_name in self.read_only_vars:
311+
raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate "
312+
f"class with read only attributes.")
313+
314+
@cached_property
315+
def _composed_schemas():
316+
# we need this here to make our import statements work
317+
# we must store _composed_schemas in here so the code is only run
318+
# when we invoke this method. If we kept this at the class
319+
# level we would get an error because the class level
320+
# code would be run when this module is imported, and these composed
321+
# classes don't exist yet because their module has not finished
322+
# loading
323+
lazy_import()
324+
return {
325+
'anyOf': [
326+
],
327+
'allOf': [
328+
AnthropicApiKeyAuthAllOf,
329+
],
330+
'oneOf': [
331+
],
332+
}

0 commit comments

Comments
 (0)