MCPcopy Create free account
hub / github.com/1Panel-dev/MaxKB / convert_to_int

Function convert_to_int

apps/models_provider/tools.py:121–127  ·  view source on GitHub ↗
(value)

Source from the content-addressed store, hash-verified

119
120def get_model_default_params(model):
121 def convert_to_int(value):
122 if isinstance(value, str):
123 try:
124 return int(value)
125 except ValueError:
126 return value
127 return value
128
129 return {
130 p.get('field'): convert_to_int(p.get('default_value'))

Callers 1

get_model_default_paramsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected