mirror of https://github.com/aliasrobotics/cai.git
This PR introduces a `strict_mode: bool = True` option to `@function_tool`, allowing optional parameters when set to False. This change enables more flexibility while maintaining strict JSON schema validation by default. resolves #43 ## Changes: - Added `strict_mode` parameter to `@function_tool` and passed it to `function_schema` and `FunctionTool`. - Updated `function_schema.py` to respect `strict_mode` and allow optional parameters when set to False. - Added unit tests to verify optional parameters work correctly, including multiple optional params with different types. ## Tests: - Verified function calls with missing optional parameters behave as expected. - Added async tests to validate behavior under different configurations. |
||
|---|---|---|
| .. | ||
| __init__.py | ||
| conftest.py | ||
| fake_model.py | ||
| test_agent_config.py | ||
| test_agent_hooks.py | ||
| test_agent_runner.py | ||
| test_agent_runner_streamed.py | ||
| test_agent_tracing.py | ||
| test_computer_action.py | ||
| test_config.py | ||
| test_doc_parsing.py | ||
| test_extension_filters.py | ||
| test_function_schema.py | ||
| test_function_tool.py | ||
| test_function_tool_decorator.py | ||
| test_global_hooks.py | ||
| test_guardrails.py | ||
| test_handoff_tool.py | ||
| test_items_helpers.py | ||
| test_max_turns.py | ||
| test_openai_chatcompletions.py | ||
| test_openai_chatcompletions_converter.py | ||
| test_openai_chatcompletions_stream.py | ||
| test_openai_responses_converter.py | ||
| test_output_tool.py | ||
| test_responses.py | ||
| test_responses_tracing.py | ||
| test_result_cast.py | ||
| test_run_config.py | ||
| test_run_step_execution.py | ||
| test_run_step_processing.py | ||
| test_strict_schema.py | ||
| test_tool_converter.py | ||
| test_trace_processor.py | ||
| test_tracing.py | ||
| test_tracing_errors.py | ||
| test_tracing_errors_streamed.py | ||
| testing_processor.py | ||