Update
This commit is contained in:
@@ -24,7 +24,7 @@ public static function getVectorEmbeddingBgeSmall($embedding_query)
|
|||||||
// Use the new API endpoint
|
// Use the new API endpoint
|
||||||
$response = Http::withHeaders([])->withOptions(['verify' => (app()->environment() == 'local') ? false : true])->timeout(800)
|
$response = Http::withHeaders([])->withOptions(['verify' => (app()->environment() == 'local') ? false : true])->timeout(800)
|
||||||
->get(
|
->get(
|
||||||
'hhttps://worker-embedding-mag.prime-42b.workers.dev',
|
'https://worker-embedding-mag.prime-42b.workers.dev',
|
||||||
[
|
[
|
||||||
'query' => $embedding_query,
|
'query' => $embedding_query,
|
||||||
]
|
]
|
||||||
@@ -44,6 +44,7 @@ public static function getVectorEmbeddingBgeSmall($embedding_query)
|
|||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
$currentAttempt++;
|
$currentAttempt++;
|
||||||
if ($currentAttempt >= $maxRetries) {
|
if ($currentAttempt >= $maxRetries) {
|
||||||
|
throw $e;
|
||||||
// we can throw exception here
|
// we can throw exception here
|
||||||
}
|
}
|
||||||
// Optional: Add sleep for a few seconds if you want to delay the next attempt
|
// Optional: Add sleep for a few seconds if you want to delay the next attempt
|
||||||
|
|||||||
@@ -197,6 +197,8 @@ private function importSingleMeme(array $meme_record): bool
|
|||||||
$embedding = null; // Continue without embedding
|
$embedding = null; // Continue without embedding
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// dd($embedding);
|
||||||
|
|
||||||
// Check if record exists one more time within transaction
|
// Check if record exists one more time within transaction
|
||||||
$existing_meme = MemeMedia::where('original_id', $meme_record['filename'])->first();
|
$existing_meme = MemeMedia::where('original_id', $meme_record['filename'])->first();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user