Skip to content

Commit

Permalink
auto codestyle cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
splitbrain committed Jun 25, 2024
1 parent 661701e commit f93272b
Show file tree
Hide file tree
Showing 6 changed files with 604 additions and 622 deletions.
2 changes: 1 addition & 1 deletion Model/Groq/ChatModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public function __construct(string $name, array $config)
throw new \Exception('Groq API key not configured');
}

$this->http->headers['Authorization'] = 'Bearer '.$config['groq_apikey'];
$this->http->headers['Authorization'] = 'Bearer ' . $config['groq_apikey'];
}

/** @inheritdoc */
Expand Down
1 change: 0 additions & 1 deletion Model/Ollama/AbstractOllama.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,5 +51,4 @@ protected function parseAPIResponse($response)

return $response;
}

}
4 changes: 2 additions & 2 deletions Model/Reka/ChatModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@ protected function request($endpoint, $data)
/** @inheritdoc */
protected function parseAPIResponse($response)
{
if(((int) $this->http->status) !== 200) {
if(isset($response['detail'])) {
if (((int) $this->http->status) !== 200) {
if (isset($response['detail'])) {
throw new \Exception('Reka API error: ' . $response['detail']);
} else {
throw new \Exception('Reka API error: ' . $this->http->status . ' ' . $this->http->error);
Expand Down
2 changes: 1 addition & 1 deletion Storage/PineconeStorage.php
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ public function deletePageChunks($page, $firstChunkID)
$this->runQuery('/vectors/delete', ['ids' => $ids]);
} catch (\Exception $e) {
// 5 is the code for "namespace not found" See #12
if($e->getCode() !== 5) throw $e;
if ($e->getCode() !== 5) throw $e;
}
}

Expand Down
4 changes: 2 additions & 2 deletions cli.php
Original file line number Diff line number Diff line change
Expand Up @@ -358,10 +358,10 @@ protected function createEmbeddings($clear)
$data = $this->helper->getRunData();
$lastEmbedModel = $data['embed used'] ?? '';

if(
if (
!$clear && $lastEmbedModel &&
$lastEmbedModel != (string) $this->helper->getEmbeddingModel()
){
) {
$this->warning('Embedding model has changed since last run. Forcing an index rebuild');
$clear = true;
}
Expand Down
Loading

0 comments on commit f93272b

Please sign in to comment.