You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
f"Skipping '{k}' -- Model-Option not supported by {self.model_id}."
108
-
)
120
+
Rules:
121
+
- Within a model_options dict, existing keys take precedence. This means remapping to mellea specific keys will maintain the value of the mellea specific key if one already exists.
122
+
- When merging, the keys/values from the dictionary passed into this function take precedence.
123
+
124
+
Because this function simplifies and then merges, non-Mellea keys from the passed in model_options will replace
125
+
Mellea specific keys from the backend's model_options.
unknown_keys= [] # keys that are unknown to litellm
177
+
unsupported_openai_params= [] # openai params that are known to litellm but not supported for this model/provider
178
+
forkeyinbackend_specific.keys():
179
+
ifkeynotinstandard_openai_subset.keys():
180
+
unknown_keys.append(key)
181
+
182
+
elifkeynotinsupported_params:
183
+
unsupported_openai_params.append(key)
184
+
185
+
iflen(unknown_keys) >0:
186
+
FancyLogger.get_logger().warning(
187
+
f"litellm allows for unknown / non-openai input params; mellea won't validate the following params that may cause issues: {', '.join(unknown_keys)}"
188
+
)
109
189
110
-
returnmo_res
190
+
iflen(unsupported_openai_params) >0:
191
+
FancyLogger.get_logger().warning(
192
+
f"litellm will automatically drop the following openai keys that aren't supported by the current model/provider: {', '.join(unsupported_openai_params)}"
f"Tool calling typically uses constrained generation, but you have specified a `format` in your generate call. NB: tool calling is superseded by format; we will NOT call tools for your request: {action}"
# invariant re: relationship between the model_options set of tools and the TemplateRepresentation set of tools
259
+
assertfn_namenotintools.keys(), (
260
+
f"Cannot add tool {fn_name} because that tool was already defined in the TemplateRepresentation for the action."
261
+
)
262
+
# type checking because ModelOptions is an untyped dict and the calling convention for tools isn't clearly documented at our abstraction boundaries.
263
+
asserttype(fn_name) isstr, (
264
+
"When providing a `ModelOption.TOOLS` parameter to `model_options`, always used the type Dict[str, Callable] where `str` is the function name and the callable is the function."
265
+
)
266
+
assertcallable(model_options_tools[fn_name]), (
267
+
"When providing a `ModelOption.TOOLS` parameter to `model_options`, always used the type Dict[str, Callable] where `str` is the function name and the callable is the function."
268
+
)
269
+
# Add the model_options tool to the existing set of tools.
0 commit comments