Validate tools :param tools: a list of assistant tools :param model: the assistant model :return:
(
tools: List[ToolRef],
model: Model,
)
| 21 | |
| 22 | |
| 23 | async def _validate_tools( |
| 24 | tools: List[ToolRef], |
| 25 | model: Model, |
| 26 | ): |
| 27 | """ |
| 28 | Validate tools |
| 29 | :param tools: a list of assistant tools |
| 30 | :param model: the assistant model |
| 31 | :return: |
| 32 | """ |
| 33 | from app.services.tool import verify_tools |
| 34 | |
| 35 | if not tools: |
| 36 | return |
| 37 | |
| 38 | if not model.allow_function_call(): |
| 39 | raise_request_validation_error( |
| 40 | f"The assistant's language model {model.model_id} does not support function call to use the tools.", |
| 41 | ) |
| 42 | |
| 43 | await verify_tools(tools) |
| 44 | |
| 45 | |
| 46 | async def _validate_retrievals( |
no test coverage detected