Add (openai): debugging points for inspector
This commit is contained in:
@@ -97,9 +97,6 @@ public static function suggestArticleTitles($current_title, $supporting_data, $s
|
|||||||
|
|
||||||
public static function chatCompletion($system_prompt, $user_prompt, $model)
|
public static function chatCompletion($system_prompt, $user_prompt, $model)
|
||||||
{
|
{
|
||||||
dump($system_prompt);
|
|
||||||
dump($user_prompt);
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$response = Http::timeout(800)->withToken(config('platform.ai.openai.api_key'))
|
$response = Http::timeout(800)->withToken(config('platform.ai.openai.api_key'))
|
||||||
->post('https://api.openai.com/v1/chat/completions', [
|
->post('https://api.openai.com/v1/chat/completions', [
|
||||||
@@ -111,7 +108,6 @@ public static function chatCompletion($system_prompt, $user_prompt, $model)
|
|||||||
],
|
],
|
||||||
]);
|
]);
|
||||||
|
|
||||||
dump($response->body());
|
|
||||||
|
|
||||||
$json_response = json_decode($response->body());
|
$json_response = json_decode($response->body());
|
||||||
|
|
||||||
@@ -120,7 +116,7 @@ public static function chatCompletion($system_prompt, $user_prompt, $model)
|
|||||||
return $reply;
|
return $reply;
|
||||||
}
|
}
|
||||||
catch(Exception $e) {
|
catch(Exception $e) {
|
||||||
Log::error($e->getMessage(), ['response' => $response->body()]);
|
Log::error($response->body());
|
||||||
inspector()->reportException($e);
|
inspector()->reportException($e);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user