| 143 | }; |
| 144 | |
| 145 | common_chat_tool_choice common_chat_tool_choice_parse_oaicompat(const std::string & tool_choice) { |
| 146 | if (tool_choice == "auto") { |
| 147 | return COMMON_CHAT_TOOL_CHOICE_AUTO; |
| 148 | } |
| 149 | if (tool_choice == "none") { |
| 150 | return COMMON_CHAT_TOOL_CHOICE_NONE; |
| 151 | } |
| 152 | if (tool_choice == "required") { |
| 153 | return COMMON_CHAT_TOOL_CHOICE_REQUIRED; |
| 154 | } |
| 155 | throw std::runtime_error("Invalid tool_choice: " + tool_choice); |
| 156 | } |
| 157 | |
| 158 | template <> |
| 159 | std::vector<common_chat_msg> common_chat_msgs_parse_oaicompat(const json & messages) { |
no outgoing calls
no test coverage detected