Files
OpenCode 68a9071cf1 feat: reconcile local master with origin (exa/hot-platform hunters, leaks ledger, latest results)
Local branch had diverged from origin/master (sibling commits on the same base). Rewrote local history linearly on top of origin/master, folding in all local content: exa/hot-platform discovery hunters, leaks ledger, nightly sweep orchestrator, updated .gitignore and skill docs, plus the latest hunt output and vault state. Remote-only files (vault keys, channel scripts) were restored rather than dropped, so the resulting tree is a full union of both sides.
2026-08-07 12:53:47 +08:00

1 line
8.8 KiB
JSON

{"repo": "andriawan/rodadua-ai", "files": {"backend/app/Services/Ai/Providers/DeepSeekProvider.php": {"d8890af857ac5fdf333a522a7199f37388255fc8": {"t": 1785746151.1458359, "n": 3146, "h": "0ad883d896b7ed70", "c": "<?php\n\nnamespace App\\Services\\Ai\\Providers;\n\nuse App\\Services\\Ai\\Contracts\\AiProviderInterface;\nuse OpenAI\\Client;\nuse OpenAI\\Factory;\n\nclass DeepSeekProvider implements AiProviderInterface\n{\n private Client $client;\n\n private string $model;\n\n private int $maxTokens;\n\n private float $temperature;\n\n public function __construct()\n {\n $config = config('services.deepseek');\n\n $this->client = (new Factory)\n ->withApiKey($config['api_key'] ?? '')\n ->withBaseUri($config['base_url'] ?? 'https://api.deepseek.com/v1')\n ->withHttpHeader('Authorization', 'Bearer '.($config['api_key'] ?? ''))\n ->make();\n\n $this->model = $config['model'] ?? 'deepseek-chat';\n $this->maxTokens = $config['max_tokens'] ?? 2000;\n $this->temperature = $config['temperature'] ?? 0.7;\n }\n\n public function chat(string $prompt, array $context = []): string\n {\n $messages = [];\n\n if (! empty($context)) {\n $messages[] = [\n 'role' => 'system',\n 'content' => $this->buildSystemMessage($context),\n ];\n }\n\n $messages[] = [\n 'role' => 'user',\n 'content' => $prompt,\n ];\n\n $response = $this->client->chat()->create([\n 'model' => $this->model,\n 'messages' => $messages,\n 'max_tokens' => $this->maxTokens,\n 'temperature' => $this->temperature,\n ]);\n\n return $response->choices[0]->message->content ?? '';\n }\n\n public function generateStructured(string $prompt, array $schema): array\n {\n $messages = [\n [\n 'role' => 'system',\n 'content' => 'You are a structured data generator. Respond only with valid JSON matching the requested schema.',\n ],\n [\n 'role' => 'user',\n 'content' => $prompt,\n ],\n ];\n\n $response = $this->client->chat()->create([\n 'model' => $this->model,\n 'messages' => $messages,\n 'max_tokens' => $this->maxTokens,\n 'temperature' => $this->temperature,\n 'response_format' => ['type' => 'json_object'],\n ]);\n\n $content = $response->choices[0]->message->content ?? '{}';\n\n return json_decode($content, true) ?? [];\n }\n\n private function buildSystemMessage(array $context): string\n {\n $parts = [\n 'You are a knowledgeable Indonesian motorcycle assistant.',\n 'Respond in Bahasa Indonesia unless otherwise specified.',\n 'Be specific to Indonesian motorcycle models, roads, and conditions.',\n ];\n\n if (isset($context['motorcycle'])) {\n $parts[] = sprintf(\n 'Motorcycle: %s %s (%d) with %d km odometer.',\n $context['motorcycle']['brand'] ?? '',\n $context['motorcycle']['model'] ?? '',\n $context['motorcycle']['year'] ?? 0,\n $context['motorcycle']['odometer_km'] ?? 0\n );\n }\n\n return implode(\"\\n\", $parts);\n }\n}\n"}, "3f1a0deb79f3b713135e71764a1e9bec135c053b": {"t": 1785760220.7559776, "n": 3150, "h": "b4b2c4ea5f6a35f9", "c": "<?php\n\nnamespace App\\Services\\Ai\\Providers;\n\nuse App\\Services\\Ai\\Contracts\\AiProviderInterface;\nuse OpenAI\\Client;\nuse OpenAI\\Factory;\n\nclass DeepSeekProvider implements AiProviderInterface\n{\n private Client $client;\n\n private string $model;\n\n private int $maxTokens;\n\n private float $temperature;\n\n public function __construct()\n {\n $config = config('services.deepseek');\n\n $this->client = (new Factory())\n ->withApiKey($config['api_key'] ?? '')\n ->withBaseUri($config['base_url'] ?? 'https://api.deepseek.com/v1')\n ->withHttpHeader('Authorization', 'Bearer ' . ($config['api_key'] ?? ''))\n ->make();\n\n $this->model = $config['model'] ?? 'deepseek-chat';\n $this->maxTokens = $config['max_tokens'] ?? 2000;\n $this->temperature = $config['temperature'] ?? 0.7;\n }\n\n public function chat(string $prompt, array $context = []): string\n {\n $messages = [];\n\n if (! empty($context)) {\n $messages[] = [\n 'role' => 'system',\n 'content' => $this->buildSystemMessage($context),\n ];\n }\n\n $messages[] = [\n 'role' => 'user',\n 'content' => $prompt,\n ];\n\n $response = $this->client->chat()->create([\n 'model' => $this->model,\n 'messages' => $messages,\n 'max_tokens' => $this->maxTokens,\n 'temperature' => $this->temperature,\n ]);\n\n return $response->choices[0]->message->content ?? '';\n }\n\n public function generateStructured(string $prompt, array $schema): array\n {\n $messages = [\n [\n 'role' => 'system',\n 'content' => 'You are a structured data generator. Respond only with valid JSON matching the requested schema.',\n ],\n [\n 'role' => 'user',\n 'content' => $prompt,\n ],\n ];\n\n $response = $this->client->chat()->create([\n 'model' => $this->model,\n 'messages' => $messages,\n 'max_tokens' => $this->maxTokens,\n 'temperature' => $this->temperature,\n 'response_format' => ['type' => 'json_object'],\n ]);\n\n $content = $response->choices[0]->message->content ?? '{}';\n\n return json_decode($content, true) ?? [];\n }\n\n private function buildSystemMessage(array $context): string\n {\n $parts = [\n 'You are a knowledgeable Indonesian motorcycle assistant.',\n 'Respond in Bahasa Indonesia unless otherwise specified.',\n 'Be specific to Indonesian motorcycle models, roads, and conditions.',\n ];\n\n if (isset($context['motorcycle'])) {\n $parts[] = sprintf(\n 'Motorcycle: %s %s (%d) with %d km odometer.',\n $context['motorcycle']['brand'] ?? '',\n $context['motorcycle']['model'] ?? '',\n $context['motorcycle']['year'] ?? 0,\n $context['motorcycle']['odometer_km'] ?? 0\n );\n }\n\n return implode(\"\\n\", $parts);\n }\n}\n"}}, "backend/config/services.php": {"d8890af857ac5fdf333a522a7199f37388255fc8": {"t": 1786067614.4450514, "n": 1894, "h": "37ab0c8ebd057659", "c": "<?php\n\nreturn [\n\n /*\n |--------------------------------------------------------------------------\n | Third Party Services\n |--------------------------------------------------------------------------\n |\n | This file is for storing the credentials for third party services such\n | as Mailgun, Postmark, AWS and more. This file provides the de facto\n | location for this type of information, allowing packages to have\n | a conventional file to locate the various service credentials.\n |\n */\n\n 'postmark' => [\n 'key' => env('POSTMARK_API_KEY'),\n ],\n\n 'resend' => [\n 'key' => env('RESEND_API_KEY'),\n ],\n\n 'ses' => [\n 'key' => env('AWS_ACCESS_KEY_ID'),\n 'secret' => env('AWS_SECRET_ACCESS_KEY'),\n 'region' => env('AWS_DEFAULT_REGION', 'us-east-1'),\n ],\n\n 'slack' => [\n 'notifications' => [\n 'bot_user_oauth_token' => env('SLACK_BOT_USER_OAUTH_TOKEN'),\n 'channel' => env('SLACK_BOT_USER_DEFAULT_CHANNEL'),\n ],\n ],\n\n /*\n |--------------------------------------------------------------------------\n | AI Provider Configuration\n |--------------------------------------------------------------------------\n */\n 'openai' => [\n 'api_key' => env('OPENAI_API_KEY'),\n 'organization' => env('OPENAI_ORGANIZATION'),\n 'model' => env('OPENAI_MODEL', 'gpt-4o-mini'),\n 'max_tokens' => (int) env('OPENAI_MAX_TOKENS', 2000),\n 'temperature' => (float) env('OPENAI_TEMPERATURE', 0.7),\n ],\n\n 'deepseek' => [\n 'api_key' => env('DEEPSEEK_API_KEY'),\n 'base_url' => env('DEEPSEEK_BASE_URL', 'https://api.deepseek.com/v1'),\n 'model' => env('DEEPSEEK_MODEL', 'deepseek-chat'),\n 'max_tokens' => (int) env('DEEPSEEK_MAX_TOKENS', 2000),\n 'temperature' => (float) env('DEEPSEEK_TEMPERATURE', 0.7),\n ],\n\n];\n"}}}}