PluginProbe
OpenStation: Desktop Windows, Dock & Virtual Desktops for WP Admin / 1.1.10
OpenStation: Desktop Windows, Dock & Virtual Desktops for WP Admin v1.1.10
1.1.10 1.1.9 1.1.8 1.1.7 1.1.6 1.1.5 1.1.4 1.1.3 1.1.2 1.1.1 1.1.0 1.0.1 1.0.0 0.9.8 0.9.7 0.9.6 0.9.4 0.9.5 0.9.3 0.9.2 0.9.1 0.9.0 0.8.9 0.8.8 0.8.7 All 34 releases
← All changes | includes/widgets/widget-drafts.php +11 -3 1.0.11.1.10 View file →
@@ -317,12 +317,20 @@
317 317 // `generate_text()` with a JSON schema — same call shape the comment
318 318 // scorer uses. The SDK can throw as well as return a WP_Error, so both
319 319 // paths land on the same 502.
320 320 try {
321 - $json = wp_ai_client_prompt( openstation_drafts_ai_prompt_text( $post ) )
321 + $builder = wp_ai_client_prompt( openstation_drafts_ai_prompt_text( $post ) )
322 322 ->using_system_instruction( openstation_drafts_ai_instructions( $post ) )
323 - ->as_json_response( openstation_ai_normalize_response_schema( openstation_drafts_ai_schema( $post ) ) )
324 - ->generate_text();
323 + ->as_json_response( openstation_ai_normalize_response_schema( openstation_drafts_ai_schema( $post ) ) );
324 +
325 + $json = openstation_ai_apply_model_config(
326 + $builder,
327 + array(
328 + 'user_id' => get_current_user_id(),
329 + 'source' => 'widgets/drafts-suggestions',
330 + 'has_schema' => true,
331 + )
332 + )->generate_text();
325 333 } catch ( \Throwable $e ) {
326 334 $json = new WP_Error( 'openstation_ai_failed', $e->getMessage() );
327 335 }
328 336