(&self, options: &GenerateOptions)
| 1048 | } |
| 1049 | |
| 1050 | pub async fn get_args(&self, options: &GenerateOptions) -> Result<PreparedArgs, ProviderError> { |
| 1051 | let model_config = get_responses_model_config(&self.model_id); |
| 1052 | let provider_options = options.provider_options.clone().unwrap_or_default(); |
| 1053 | let mut warnings = validate_responses_settings( |
| 1054 | &model_config, |
| 1055 | &provider_options, |
| 1056 | options.top_k, |
| 1057 | options.seed, |
| 1058 | options.presence_penalty, |
| 1059 | options.frequency_penalty, |
| 1060 | options.stop_sequences.as_deref(), |
| 1061 | options.temperature, |
| 1062 | options.top_p, |
| 1063 | ); |
| 1064 | |
| 1065 | let strict_json_schema = provider_options.strict_json_schema.unwrap_or(false); |
| 1066 | let prepared_tools = prepare_responses_tools( |
| 1067 | options.tools.as_deref(), |
| 1068 | options.tool_choice.as_ref(), |
| 1069 | strict_json_schema, |
| 1070 | ); |
| 1071 | |
| 1072 | let has_local_shell_tool = prepared_tools |
| 1073 | .tools |
| 1074 | .as_ref() |
| 1075 | .map(|tools| { |
| 1076 | tools |
| 1077 | .iter() |
| 1078 | .any(|tool| matches!(tool, ResponsesTool::LocalShell {})) |
| 1079 | }) |
| 1080 | .unwrap_or(false); |
| 1081 | |
| 1082 | let store = provider_options.store.unwrap_or(true); |
| 1083 | let (input, convert_warnings) = convert_to_openai_responses_input( |
| 1084 | &options.prompt, |
| 1085 | model_config.system_message_mode, |
| 1086 | self.config.file_id_prefixes.as_deref(), |
| 1087 | store, |
| 1088 | has_local_shell_tool, |
| 1089 | ) |
| 1090 | .await; |
| 1091 | |
| 1092 | warnings.extend(convert_warnings); |
| 1093 | warnings.extend(prepared_tools.tool_warnings); |
| 1094 | |
| 1095 | let mut include = provider_options.include.clone().unwrap_or_default(); |
| 1096 | if provider_options |
| 1097 | .logprobs |
| 1098 | .as_ref() |
| 1099 | .and_then(LogprobsSetting::top_logprobs) |
| 1100 | .is_some() |
| 1101 | { |
| 1102 | push_include( |
| 1103 | &mut include, |
| 1104 | ResponsesIncludeValue::MessageOutputTextLogprobs, |
| 1105 | ); |
| 1106 | } |
| 1107 |
no test coverage detected