PluginProbe
ShopBuilder – WooCommerce Builder For Elementor / 3.2.6
ShopBuilder – WooCommerce Builder For Elementor v3.2.6
3.4.2 3.4.1 3.4.0 2.0.1 2.0.2 2.0.3 2.1.0 2.1.1 2.1.10 2.1.11 2.1.12 2.1.13 2.1.14 2.1.15 2.1.2 2.1.3 2.1.4 2.1.5 2.1.6 2.1.7 2.1.8 2.1.9 2.2.0 2.2.1 2.2.2 All 63 releases
shopbuilder / app / AI / AIServices / DeepSeekAdapter.php

DeepSeekAdapter.php in ShopBuilder – WooCommerce Builder For Elementor 3.2.6, at app/AI/AIServices/DeepSeekAdapter.php

68 lines 1.8 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace RadiusTheme\SB\AI\AIServices;
4
5 use RadiusTheme\SB\AI\AIFns;
6 use RadiusTheme\SB\AI\AIServices\Interface\AIServiceInterface;
7
8 /**
9 * Class DeepSeekAdapter
10 *
11 * Providing standardized methods for generating AI responses,
12 * keyword suggestions, and form field data.
13 */
14 class DeepSeekAdapter implements AIServiceInterface {
15
16 /**
17 * The DeepSeek client instance.
18 *
19 * @var object
20 */
21 private $deepSeekClient;
22
23 /**
24 * Constructor.
25 *
26 * Initializes the adapter with a DeepSeek client instance.
27 *
28 * @param object $deepSeekClient An instance of the DeepSeek client.
29 */
30 public function __construct( $deepSeekClient ) {
31 $this->deepSeekClient = $deepSeekClient;
32 }
33 /**
34 * Generate a general AI response using the DeepSeek client.
35 *
36 * @param string $content_type The type of content to generate (title, description, short_description).
37 * @param string $instruction The product information or user instruction.
38 *
39 * @return string The AI-generated response text.
40 */
41 public function generateResponse( string $content_type, string $instruction ): string {
42 $system_prompt = AIFns::build_prompt( $content_type, $instruction );
43 return $this->deepSeekClient->ask( $instruction, $system_prompt );
44 }
45
46 /**
47 * Generate keyword-based AI suggestions or responses using the DeepSeek client.
48 *
49 * @param mixed $data Input data for keyword generation.
50 *
51 * @return mixed The AI-generated keyword response.
52 */
53 public function generateKeywordResponse( $data ) {
54 return $this->deepSeekClient->askKeyword( $data );
55 }
56
57 /**
58 * Generate semantic text embeddings using the DeepSeek API.
59 *
60 * @param mixed $data The input text or data used to create embeddings.
61 *
62 * @return mixed The embedding vector array or DeepSeek API response.
63 */
64 public function generateEmbedding( $data ) {
65 return [];
66 }
67 }
68