Add Google and Groq AI providers, enhance provider manager, and implement conversation and logging services
- Introduced `Groq_AI_Provider_Google` and `Groq_AI_Provider_Groq` classes for handling AI interactions with Google and Groq respectively. - Enhanced `Groq_AI_Provider_Manager` to register and manage multiple AI providers. - Implemented `Groq_AI_Conversation_Manager` for managing conversation IDs and context hashes. - Added `Groq_AI_Generation_Logger` for logging AI generation events and managing log tables. - Developed `Groq_AI_Prompt_Builder` for constructing prompts and processing AI responses. - Established `Groq_AI_Settings_Manager` for managing plugin settings, including context fields and module configurations.
This commit is contained in:
36
includes/Providers/class-groq-ai-provider-groq.php
Normal file
36
includes/Providers/class-groq-ai-provider-groq.php
Normal file
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
class Groq_AI_Provider_Groq extends Groq_AI_Abstract_OpenAI_Provider {
|
||||
public function get_key() {
|
||||
return 'groq';
|
||||
}
|
||||
|
||||
public function get_label() {
|
||||
return __( 'Groq', 'groq-ai-product-text' );
|
||||
}
|
||||
|
||||
public function get_default_model() {
|
||||
return 'llama3-70b-8192';
|
||||
}
|
||||
|
||||
public function get_available_models() {
|
||||
return [
|
||||
'llama3-70b-8192',
|
||||
'llama3-8b-8192',
|
||||
'mixtral-8x7b-32768',
|
||||
'gemma-7b-it',
|
||||
];
|
||||
}
|
||||
|
||||
public function get_option_key() {
|
||||
return 'groq_api_key';
|
||||
}
|
||||
|
||||
protected function get_endpoint() {
|
||||
return 'https://api.groq.com/openai/v1/chat/completions';
|
||||
}
|
||||
|
||||
protected function get_models_endpoint() {
|
||||
return 'https://api.groq.com/openai/v1/models';
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user