(assistant_message: dict)
| 494 | |
| 495 | |
| 496 | def assistant_function_to_tool(assistant_message: dict) -> dict: |
| 497 | assert "function_call" in assistant_message |
| 498 | new_msg = copy.deepcopy(assistant_message) |
| 499 | function_call = new_msg.pop("function_call") |
| 500 | new_msg["tool_calls"] = [ |
| 501 | { |
| 502 | "id": get_tool_call_id(), |
| 503 | "type": "function", |
| 504 | "function": function_call, |
| 505 | } |
| 506 | ] |
| 507 | return new_msg |
| 508 | |
| 509 | |
| 510 | def is_optional_type(hint): |
nothing calls this directly
no test coverage detected