feat: Update plugin to version 1.2.0 with new image context features
- Added support for image context in product prompts, allowing images to be sent as URLs or Base64. - Introduced a new settings page for managing prompt configurations. - Implemented caching for allowed models per provider to enhance performance. - Enhanced logging to include image context usage details. - Added model exclusions management to prevent the use of specific models. - Updated AJAX controller to handle image context in requests. - Refactored prompt builder to support image context in prompts.
This commit is contained in:
@@ -136,6 +136,7 @@ class Groq_AI_Logs_Table extends WP_List_Table {
|
||||
|
||||
protected function column_created_at( $item ) {
|
||||
$date = esc_html( mysql2date( get_option( 'date_format' ) . ' ' . get_option( 'time_format' ), $item['created_at'] ) );
|
||||
$usage = $this->get_usage_meta( $item );
|
||||
$payload = [
|
||||
'created_at' => $item['created_at'],
|
||||
'user' => $this->column_default( $item, 'user_id' ),
|
||||
@@ -149,6 +150,7 @@ class Groq_AI_Logs_Table extends WP_List_Table {
|
||||
'prompt' => $item['prompt'],
|
||||
'response' => $item['response'],
|
||||
'error_message' => $item['error_message'],
|
||||
'image_context' => isset( $usage['image_context'] ) ? $usage['image_context'] : null,
|
||||
];
|
||||
$encoded = esc_attr( wp_json_encode( $payload ) );
|
||||
return sprintf(
|
||||
@@ -157,4 +159,14 @@ class Groq_AI_Logs_Table extends WP_List_Table {
|
||||
$date
|
||||
);
|
||||
}
|
||||
|
||||
private function get_usage_meta( $item ) {
|
||||
if ( empty( $item['usage_json'] ) ) {
|
||||
return [];
|
||||
}
|
||||
|
||||
$data = json_decode( $item['usage_json'], true );
|
||||
|
||||
return is_array( $data ) ? $data : [];
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user