Skip to content

Commit

Permalink
add debug info
Browse files Browse the repository at this point in the history
  • Loading branch information
psorensen committed Aug 2, 2024
1 parent d9e08b0 commit 5369138
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions includes/Classifai/Providers/Azure/Language.php
Original file line number Diff line number Diff line change
Expand Up @@ -212,9 +212,21 @@ public function rest_endpoint_callback( $post_id = 0, string $route_to_call = ''
* @return array
*/
public function get_debug_information(): array {
$settings = $this->feature_instance->get_settings();
$debug_info = [];
$settings = $this->feature_instance->get_settings();
$provider_settings = $settings[ static::ID ];
$debug_info = [];

if ( $this->feature_instance instanceof ExcerptGeneration ) {
$debug_info[ __( 'Excerpt length', 'classifai' ) ] = apply_filters( 'classifai_azure_language_summary_length', 'oneSentence' );
$debug_info[ __( 'Provider', 'classifai' ) ] = 'Azure Language Services';
$debug_info[ __( 'Endpoint URL', 'classifai' ) ] = $provider_settings['endpoint_url'];
}

return $debug_info;
return apply_filters(
'classifai_' . self::ID . '_debug_information',
$debug_info,
$settings,
$this->feature_instance
);
}
}

0 comments on commit 5369138

Please sign in to comment.